mengding / jofc2

Automatically exported from code.google.com/p/jofc2
GNU Lesser General Public License v3.0
0 stars 0 forks source link

computeYAxisRange creates NaN #45

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Have one single point and use computeYAxisRange

This will make min and max equal and thus NaN after all Math operations.

Fix:
if (min == max) {
    min = 0.0;
}

Original issue reported on code.google.com by johansalllarsson on 2 Feb 2010 at 9:37

GoogleCodeExporter commented 9 years ago
One could argue, what is the point to compute the YAxis range when you have one 
single point.
Beside that, I am not sure one would really want the min (or max if it is a 
negative 
value) to be 0 when you have one single entry point.
It is linked to Issue 11, that user might or not want to have 0 as its min or 
max 
value.
The best way would be to reuse a min value set by the user if necessary. So in 
your 
case set a min value to 0 to the YAxis for all your charts.

Original comment by pierreyv...@gmail.com on 29 Mar 2010 at 6:47

GoogleCodeExporter commented 9 years ago
It should now take the value of the single element as min.
It will also retrieve the min value if you set it before on the YAxis.

Original comment by pierreyv...@gmail.com on 29 Mar 2010 at 7:04