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

Issue #119 - Bar chart - allow null values in data series

parent 7e81c928
No related branches found
No related tags found
No related merge requests found
......@@ -50,7 +50,7 @@ public class BarChart04 implements ExampleChart {
// Create Chart
Chart chart = new ChartBuilder().chartType(ChartType.Bar).width(800).height(600).title("XFactor vs. Age").xAxisTitle("Age").yAxisTitle("XFactor").build();
chart.addCategorySeries("female", Arrays.asList(new Integer[] { 10, 20, 30, 40, 50 }), Arrays.asList(new Integer[] { 50, 10, 20, 40, 35 }));
chart.addCategorySeries("male", Arrays.asList(new Integer[] { 10, 20, 30, 40, 50 }), Arrays.asList(new Integer[] { 40, 30, 20, 0, 60 }));
chart.addCategorySeries("male", Arrays.asList(new Integer[] { 10, 20, 30, 40, 50 }), Arrays.asList(new Integer[] { 40, 30, 20, null, 60 }));
chart.getStyleManager().setYAxisMin(5);
chart.getStyleManager().setYAxisMax(70);
......
......@@ -117,7 +117,15 @@ public class PlotContentCategoricalChart_Bar extends PlotContent {
int categoryCounter = 0;
while (yItr.hasNext()) {
double y = yItr.next().doubleValue();
Number next = yItr.next();
if (next == null) {
previousX = -Double.MAX_VALUE;
previousY = -Double.MAX_VALUE;
categoryCounter++;
continue;
}
double y = next.doubleValue();
double yTop = 0.0;
double yBottom = 0.0;
......
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