Is this a bug or do I not understand the chart.ymax property?

« Back to message list

Enter your email address to get email updates on this topic. You can stop receiving updates by clicking the link in the update email messages.

Posted by Jason Black on 24th January 2013
It seems to be impossible to get a line chart with a _fixed_ vertical scale of 0.0 to 1.0.

Setting chart.ymax to 1 (or 1.0, or 0.9999, or 1.1) results in a chart with y-axis values labeled as ["0", "0", "1", "1", "1"] (That is, as the result of integer rounding of the interpolated fractional values). Note that the line chart itself is drawn correctly, it's just that the labels are messed up.

Experimenting with ymax values greater than 1, the labels come out how you'd expect, which is what leads me to think this might be a bug.

Either way how can I force a line chart to have a scale of 0.0 to 1.0, and labels of "0.2", "0.4", ..., "1.0"?
Posted by Jason Black on 24th January 2013
Never mind. I figured it out:

myChart.set('chart.scale.decimals', 1)

Add a reply

« Back to message list