Skip to content

Commit

Permalink
Fix for NullPointerException
Browse files Browse the repository at this point in the history
Added empty strings for labelItems. I don’t know what they are of where they are used. Got NullPointerException before and now it at least works.
  • Loading branch information
jonalv committed May 28, 2014
1 parent 90abdfb commit 761f0c0
Showing 1 changed file with 10 additions and 2 deletions.
Expand Up @@ -100,12 +100,20 @@ public void linePlot(double[] xValues, double[] yValues, String xLabel, String y
*/

public void scatterPlot(double[] xValues, double[] yValues) {
this.scatterPlot( xValues, yValues, "X-axis", "Y-axis", "Scatter plot", null );
String[] labelItems = new String[xValues.length];
for ( int i = 0 ; i < labelItems.length ; i++ ) {
labelItems[i] = i + "";
}
this.scatterPlot( xValues, yValues, "X-axis", "Y-axis", "Scatter plot", labelItems);
}

public void scatterPlot(double[] xValues, double[] yValues, String xLabel,
String yLabel, String title) {
this.scatterPlot( xValues, yValues, xLabel, yLabel, title, null );
String[] labelItems = new String[xValues.length];
for ( int i = 0 ; i < labelItems.length ; i++ ) {
labelItems[i] = i + "";
}
this.scatterPlot( xValues, yValues, xLabel, yLabel, title, labelItems );
}

public void scatterPlot(double[] xValues, double[] yValues, String xLabel,
Expand Down

0 comments on commit 761f0c0

Please sign in to comment.