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