Chart - VerticalAxis - setNumberFormat

Hi,


I am using the below code to display numbers in bytes format on a chart. But the problem is, it is displaying 0.0 MB for small numbers.

p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 17.0px Monaco} p.p2 {margin: 0.0px 0.0px 0.0px 0.0px; font: 17.0px Monaco; color: #3933ff} p.p3 {margin: 0.0px 0.0px 0.0px 0.0px; font: 17.0px Monaco; min-height: 22.0px} span.s1 {color: #0326cc} span.s2 {color: #931a68} span.s3 {color: #000000} span.Apple-tab-span {white-space:pre}

chart.getAxes().getVerticalAxis().setNumberFormatLinkedToSource(false);

chart.getAxes().getVerticalAxis().setNumberFormat("[<1000000000]0.0,,\" MB\";[<1000000000000]0.0,,,\" GB\";0.0,,,,\" TB\"");

chart.setLegend(false);



Example: If the numbers are [5216, 4968, 4952, 4872, 4840] , On the chart it displays 0.0 MB


If the numbers are [52160000, 49680000, 49520000, 48720000, 48400000], On the chart it displays 54.0 MB, 52.0 MB, 50.0 MB, 48.0 MB, 46.0 MB.


Screen shots are attached for both cases.


Please let me know the correct syntax to display all ranges of number values. That means If the value is less than 1000, display as it is otherwise display in KB or MB or GB or TB.


Thanks.

p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px 'Helvetica Neue'; color: #454545}

p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px 'Helvetica Neue'; color: #454545}

Hi,

I have observed your requirements and suggest you to please visit this documentation link for information about how to set number formats for chart data cells. I hope this will be helpful. Please share if I may help you further in this regard.

Many Thanks,