Hi
- my chart is a StackedXYAreaChart one
but I don't understard why it has the white vertical lines ...
thanks a lot
best regards
StackedXYAreaChart with strange lines
-
- JFreeChart Project Leader
- Posts: 11734
- Joined: Fri Mar 14, 2003 10:29 am
- antibot: No, of course not.
- Contact:
Re: StackedXYAreaChart with strange lines
There is a "bar painter" object in the renderer that, by default, draws bars with a gradient effect. You can replace that with any painter you want, for example if you just want bars with a flat solid color:
Code: Select all
BarRenderer renderer = (BarRenderer) plot.getRenderer();
renderer.setBarPainter(new StandardBarPainter());
David Gilbert
JFreeChart Project Leader
Read my blog
Support JFree via the Github sponsorship program
JFreeChart Project Leader
Read my blog
Support JFree via the Github sponsorship program
Re: StackedXYAreaChart with strange lines
hi David
thanks for you anwser. It is ok now
but i need your helps please
here are my codes:
could you tell me if it is well done?
thanks a lot
thanks for you anwser. It is ok now
but i need your helps please
here are my codes:
could you tell me if it is well done?
thanks a lot
Code: Select all
XYSeries xyseries1 = new XYSeries("serie 1", true, false); // idem for 2,3,4
// add valeu to xyserie1, 2, 3, 4
DefaultTableXYDataset defautDataSet = new DefaultTableXYDataset();
defautDataSet .addSeries(xyseries1); // idem for 2,3,4
chart = ChartFactory.createStackedXYAreaChart(
"Title", //
"X", //
"Y", //
defautDataSet ,
PlotOrientation.VERTICAL, true, true, false);
// and then...
StackedXYBarRenderer stackedbarrenderer = new StackedXYBarRenderer();
stackedbarrenderer.setBarPainter(new StandardXYBarPainter());
stackedbarrenderer.setToolTipGenerator(new StandardXYToolTipGenerator());
//stackedbarrenderer.setDrawBarOutline(false);
//stackedbarrenderer.setItemLabelsVisible(true);
stackedbarrenderer.setShadowVisible(false);
stackedbarrenderer.setSeriesPaint(0, Color.decode("#953735"));
stackedbarrenderer.setSeriesPaint(1, Color.decode("#92D050"));
stackedbarrenderer.setSeriesPaint(2, Color.decode("#FAC090"));
stackedbarrenderer.setSeriesPaint(3, Color.decode("#71588F"));
xyplot.setRenderer(0, stackedbarrenderer);
-
- JFreeChart Project Leader
- Posts: 11734
- Joined: Fri Mar 14, 2003 10:29 am
- antibot: No, of course not.
- Contact:
Re: StackedXYAreaChart with strange lines
That looks fine to me. There is a version of the ChartFactory.createStackedXYAreaChart() method with less parameters that you could use and you could modify the existing renderer rather than creating and setting a new one, but those things are very minor points.
David Gilbert
JFreeChart Project Leader
Read my blog
Support JFree via the Github sponsorship program
JFreeChart Project Leader
Read my blog
Support JFree via the Github sponsorship program
-
- JFreeChart Project Leader
- Posts: 11734
- Joined: Fri Mar 14, 2003 10:29 am
- antibot: No, of course not.
- Contact:
Re: StackedXYAreaChart with strange lines
That looks fine to me. There is a version of the ChartFactory.createStackedXYAreaChart() method with less parameters that you could use and you could modify the existing renderer rather than creating and setting a new one, but those things are very minor points.
David Gilbert
JFreeChart Project Leader
Read my blog
Support JFree via the Github sponsorship program
JFreeChart Project Leader
Read my blog
Support JFree via the Github sponsorship program
Re: StackedXYAreaChart with strange lines
Isn't this the simplest way to make that go away?
Code: Select all
XYBarRenderer.setDefaultShadowsVisible(false);