You must be logged in to post your query.
Home › Forums › Chart Support › LabelFormatter Error
Tagged: labelFormatter
Hello.
I use canvasJS for charts.
When I use labelFormatter in YAxis Options, it seems work weird.
This is an example.
https://jsfiddle.net/Lqegab5v/5/
I did not fix the value. But number 1.2 is changed 1.20000000002.
So how to solve this problem?
Thank you.
@jeonkook,
The issue seems to be happening as you are returning the value as such in labelFormatter without formatting it. You can format the number to fix the number of decimal values by using formatNumber method. CanvasJS.formatNumber(e.value, "#,##0.##") Please take a look at this updated JSFiddle for working sample.
CanvasJS.formatNumber(e.value, "#,##0.##")
Also, please refer to valueFormatString which lets you format the value that appears in axis / parameter that you pass in formatNumber method.
— Vishwas R Team CanvasJS
You must be logged in to reply to this topic. Login/Register