Reputation: 55
I used the createStackedAreaChart()
, but the stacked area chart I got is not continous. There are gaps between categories (just look like stacked bar chart). But If I use createAreaChart()
for the same dataset (DefaultCategoryDataset
), the area chart is fine. What's wrong with the stacked area chart? I would really appreciate any help.
Upvotes: 0
Views: 1768
Reputation: 1
In StackedAreaRenderer.java, the coordinate of Path has decimals, path is discontinuous in ANTIALIAS. Modify StackedAreaRenderer#drawItem with Math.round like AreaRenderer.java.
Upvotes: 0
Reputation: 55
I got it. Somehow, I have to set the category margin to avoid the gaps in the chart. domainAxis.setCategoryMargin(0);
Upvotes: 2
Reputation: 205785
Using the CategoryDataset
returned by createDataset()
in BarChartDemo1
, the static factory method ChartFactory.createStackedAreaChart()
produces the following chart with no gaps. You should examine your data set critically.
Upvotes: 1