I need to make the stacked area chart as continuous as shown below:
http://www.raunakkathuria.com/images/jf ... achart.jpg
what i have actually done is
http://www.raunakkathuria.com/images/jf ... _chart.jpg
I tried setting the series outline but by default XYAreaRenderer2 has outline visible as false, the below code snapshot from JFreeChart Api depicts that:
Code: Select all
public XYAreaRenderer2(XYToolTipGenerator labelGenerator,
XYURLGenerator urlGenerator) {
super();
this.showOutline = false; // set to false by default
setBaseToolTipGenerator(labelGenerator);
setURLGenerator(urlGenerator);
GeneralPath area = new GeneralPath();
area.moveTo(0.0f, -4.0f);
area.lineTo(3.0f, -2.0f);
area.lineTo(4.0f, 4.0f);
area.lineTo(-4.0f, 4.0f);
area.lineTo(-3.0f, -2.0f);
area.closePath();
this.legendArea = area;
}
Code: Select all
public ExtendedXYAreaRenderer2(XYToolTipGenerator labelGenerator,
XYURLGenerator urlGenerator) {
super();
this.showOutline = true; // made it to true
setBaseToolTipGenerator(labelGenerator);
setURLGenerator(urlGenerator);
GeneralPath area = new GeneralPath();
area.moveTo(0.0f, -4.0f);
area.lineTo(3.0f, -2.0f);
area.lineTo(4.0f, 4.0f);
area.lineTo(-4.0f, 4.0f);
area.lineTo(-3.0f, -2.0f);
area.closePath();
this.legendArea = area;
}
Code: Select all
.....
XYPlot xyplot = (XYPlot) chart.getPlot();
XYItemRenderer render = xyplot.getRenderer();
....
render.setBaseOutlinePaint(new Color(222, 222, 194));
render.setBaseOutlineStroke(new BasicStroke(2f));
render.setSeriesOutlinePaint(0, new Color(0, 0, 0));
render.setSeriesOutlineStroke(0, new BasicStroke(1.5f));
render.setSeriesOutlinePaint(1, new Color(51, 51, 51));
render.setSeriesOutlineStroke(1, new BasicStroke(1.5f));
render.setSeriesOutlinePaint(2, new Color(104, 104, 104));
render.setSeriesOutlineStroke(2, new BasicStroke(1.5f));
Is there any other method or any other way through which this can be accomplished.
Thanks & Regards