Kemallyson / flot

Automatically exported from code.google.com/p/flot
MIT License
0 stars 0 forks source link

plot function throws exception when all data points have the same y-value and that value exceeds 1E15 #631

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
This FLOT example throws an exception:

<script type="text/javascript" src="jquery-1.6.2.min.js"></script>
<script type="text/javascript" src="flot.js"></script>
<div id="placeholder" style="width:600px;height:300px">What?</div>
<script type="text/javascript">
$.plot($("#placeholder"), [ [[0, 1.0E15], [1, 1.0E15]] ]);
</script>

The problem is in the function setRange, near the top, in the if-block 
"if(delta==0)". The if-block tries to eliminate the case where axis min and 
axis max are the same. It does so by adding .01 to the max or subtracting .01 
from min. That does not work for numbers whose absolute value is greater than 
1E15 or so.

Original issue reported on code.google.com by WalksWit...@gmail.com on 15 Nov 2011 at 1:40

GoogleCodeExporter commented 9 years ago

Original comment by dnsch...@gmail.com on 8 May 2012 at 12:18