javascript - Highcharts rounding yaxis and xaxis digits -
i trying round yaxis , xaxis down. example 3843 should 3.843 on graph , tooltip show 3.843 k.
i have got tooltip working cant change graphs yaxis , xaxis value graph can show sides fully.
as can see here: http://jsfiddle.net/kzl0phfu/
this xaxis looks like
yaxis: { gridlineinterpolation: 'polygon', linewidth: 0, min: 0, gridlinecolor: "#808080", gridlinedashstyle: "solid", gridlinewidth: 2, labels: { format: '{value:.2f}', style: { color: '#c4c4c4', font: '11px trebuchet ms, verdana, sans-serif' } } }
use datalabels
formatter
achieve desired result
plotoptions: { area: { datalabels: { usehtml: true, enabled: true, formatter: function() { value = this.y; numericsymboldetector = math.abs(this.y); if (numericsymboldetector > 1000) { value = highcharts.numberformat(value / 1000, 3, '.', '') ; } return value }, style: { color: '#c4c4c4', font: '5px trebuchet ms, verdana, sans-serif' } }, //enablemousetracking: false }, series: { linecolor: '#808080' } },
fiddle demonstration
Comments
Post a Comment