Take care of edge cases when calculating intervals (labelCount == 0)
This commit is contained in:
parent
1bbf4be1ee
commit
6c17ca45de
2 changed files with 8 additions and 0 deletions
|
@ -162,6 +162,10 @@ public abstract class AxisRenderer extends Renderer {
|
|||
|
||||
// Find out how much spacing (in y value space) between axis values
|
||||
double rawInterval = range / labelCount;
|
||||
if (Double.isInfinite(rawInterval))
|
||||
{
|
||||
rawInterval = range > 0.0 ? range : 1.0;
|
||||
}
|
||||
double interval = Utils.roundToNextSignificant(rawInterval);
|
||||
|
||||
// If granularity is enabled, then do not allow the interval to go below specified granularity.
|
||||
|
|
|
@ -40,6 +40,10 @@ public class YAxisRendererRadarChart extends YAxisRenderer {
|
|||
|
||||
// Find out how much spacing (in y value space) between axis values
|
||||
double rawInterval = range / labelCount;
|
||||
if (Double.isInfinite(rawInterval))
|
||||
{
|
||||
rawInterval = range > 0.0 ? range : 1.0;
|
||||
}
|
||||
double interval = Utils.roundToNextSignificant(rawInterval);
|
||||
|
||||
// If granularity is enabled, then do not allow the interval to go below specified granularity.
|
||||
|
|
Loading…
Add table
Reference in a new issue