Weird chart maximum axis x value (Real Challenge)

前端 未结 1 961
清酒与你
清酒与你 2021-01-26 04:37

Here you can see a chart created using graphael. http://jsfiddle.net/aNJxf/4/

It is shown with it\'s y axis correctly.

The first y value is 0.03100 and the maxim

1条回答
  •  北海茫月
    2021-01-26 04:59

    Sorry, I'm not real familiar with gRaphael, but I did find that converting your yVals into whole numbers (by multiplying each by 1e5) seemed to rid your chart of the awkward behavior.

    This suggests that it could be related to the algorithm gRaphael uses to find the max axis value (as you ask in your related question) when your values are small decimal values (and alter at even more significant digits).

    I know there are inherent issues with float precision, but I can't be sure that applies to your case, or that your values are low enough to consider this.

    Not the best workaround, but if it would be feasible for you, you could display the yValues in an order of magnitude larger, and remind the viewer that they are actually smaller than presented. For example, your chart could go from 0 to 3100 and remind your viewer that the scale is scale * 1e-5.

    0 讨论(0)
提交回复
热议问题