Chart.Scatter icon indicating copy to clipboard operation
Chart.Scatter copied to clipboard

Bug: scaleOverride floating point error

Open jakobt480 opened this issue 10 years ago • 1 comments

When incrementing with scaleStepWidth containing floating point numbers there is a rounding error that courses really long label values. This doesn't occur with the standard charts in chart.js, when using the same scaling. Made a hack fix by using Math.round in line 295.

labelsArray[index] = helpers.template(templateString, { value: (graphMin + Math.round((stepValue * (index)) * 100) / 100).toFixed(stepDecimalPlaces) });

jakobt480 avatar Jan 18 '16 19:01 jakobt480

Hi

I'm sorry, that did not answer for a long time. Could you give me an example on jsfiddle.net or similar site? I will use this as an error correction criterion.

dima117 avatar Feb 11 '16 08:02 dima117