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

bug fix: SeriesMarker.NONE causing NPE

parent 8c7affb8
Branches
No related tags found
No related merge requests found
...@@ -25,13 +25,18 @@ import java.util.Random; ...@@ -25,13 +25,18 @@ import java.util.Random;
import com.xeiam.xchart.Chart; import com.xeiam.xchart.Chart;
import com.xeiam.xchart.ChartBuilder; import com.xeiam.xchart.ChartBuilder;
import com.xeiam.xchart.Series;
import com.xeiam.xchart.SwingWrapper; import com.xeiam.xchart.SwingWrapper;
import com.xeiam.xchart.demo.charts.ExampleChart; import com.xeiam.xchart.demo.charts.ExampleChart;
import com.xeiam.xchart.style.SeriesMarker;
/** /**
* Millisecond Scale * Millisecond Scale
* * <p>
* @author timmolter * Demonstrates the following:
* <ul>
* <li>Millisecond Scale
* <li>Series with no Markers
*/ */
public class DateChart01 implements ExampleChart { public class DateChart01 implements ExampleChart {
...@@ -68,7 +73,8 @@ public class DateChart01 implements ExampleChart { ...@@ -68,7 +73,8 @@ public class DateChart01 implements ExampleChart {
yData.add(Math.random() * i); yData.add(Math.random() * i);
} }
chart.addDateSeries("blah", xData, yData); Series series = chart.addDateSeries("blah", xData, yData);
series.setMarker(SeriesMarker.NONE);
return chart; return chart;
......
...@@ -153,8 +153,10 @@ public class PlotContentLineChart extends PlotContent { ...@@ -153,8 +153,10 @@ public class PlotContentLineChart extends PlotContent {
previousY = yOffset; previousY = yOffset;
// paint marker // paint marker
g.setColor(series.getMarkerColor()); if (series.getMarker() != null) {
series.getMarker().paint(g, xOffset, yOffset); g.setColor(series.getMarkerColor());
series.getMarker().paint(g, xOffset, yOffset);
}
// paint errorbar // paint errorbar
if (errorBars != null) { if (errorBars != null) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment