Skip to content
Snippets Groups Projects
Commit 7e6566ef authored by Tim Molter's avatar Tim Molter
Browse files

handled NaN values during plot paint

parent 1ea4a23f
No related branches found
No related tags found
No related merge requests found
No preview for this file type
......@@ -131,10 +131,10 @@ public class AxisTick implements IChartPart {
*/
private void determineAxisTick() {
System.out.println("workingSpace= " + workingSpace);
// System.out.println("workingSpace= " + workingSpace);
int tickSpace = AxisPair.getTickSpace(workingSpace);
System.out.println("tickSpace= " + tickSpace);
// System.out.println("tickSpace= " + tickSpace);
int margin = AxisPair.getMargin(workingSpace, tickSpace);
......
......@@ -72,13 +72,15 @@ public class PlotContent implements IChartPart {
for (int i = 0; i < xData.length; i++) {
if (Double.isInfinite(xData[i]) || Double.isNaN(xData[i])) {
throw new RuntimeException("Infinite or NaN values in xAxis Data not allowed!!!");
}
// if (Double.isInfinite(xData[i]) || Double.isNaN(xData[i])) {
// throw new RuntimeException("Infinite or NaN values in xAxis Data not allowed!!!");
// }
//
// if (Double.isInfinite(yData[i]) || Double.isNaN(yData[i])) {
// throw new RuntimeException("Infinite or NaN values in yAxis Data not allowed!!!");
// }
if (Double.isInfinite(yData[i]) || Double.isNaN(yData[i])) {
throw new RuntimeException("Infinite or NaN values in yAxis Data not allowed!!!");
}
if (!Double.isInfinite(xData[i]) && !Double.isNaN(xData[i]) && !Double.isInfinite(yData[i]) && !Double.isNaN(yData[i])) {
int xTransform = (int) (xLeftMargin + ((xData[i] - xMin) / (xMax - xMin) * xTickSpace));
int yTransform = (int) (bounds.getHeight() - (yTopMargin + (yData[i] - yMin) / (yMax - yMin) * yTickSpace));
......@@ -116,3 +118,4 @@ public class PlotContent implements IChartPart {
}
}
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment