I am using StackedBar3D fo my JSP, I am using
StackedBarRenderer3D rend = new StackedBarRenderer3D();
rend.setSeriesPaint(0, Color.GREEN);
rend.setSeriesPaint(1, Color.RED);
However my bar color not getting changed, someone could kindly help?
Thanks in advance
Color Not Changing
I am calling the StackedBarRenderer3D rend nefore JFreeChart chart gets initialized.
I am pasting my code, kindly correct my mistakes.
***** JSP*****
CategoryAxis categoryAxis = new CategoryAxis("Site");
ValueAxis valueAxis = new NumberAxis("Value");
StackedBarRenderer3D rend = new StackedBarRenderer3D();
StandardCategoryToolTipGenerator tt = new StandardCategoryToolTipGenerator();
rend.setItemURLGenerator(new StandardCategoryURLGenerator("xy_chart.jsp","series","section"));
rend.setToolTipGenerator(new StandardCategoryToolTipGenerator());
rend.setDrawBarOutline(true);
rend.setItemURLGenerator(new StandardCategoryURLGenerator("xy_chart.jsp","series","section"));
CategoryPlot plot = new CategoryPlot(data, categoryAxis, valueAxis, rend);
JFreeChart chart = new JFreeChart("rr", JFreeChart.DEFAULT_TITLE_FONT, plot, true);
rend = chart.getPlot().getRenderer();
I am pasting my code, kindly correct my mistakes.
***** JSP*****
CategoryAxis categoryAxis = new CategoryAxis("Site");
ValueAxis valueAxis = new NumberAxis("Value");
StackedBarRenderer3D rend = new StackedBarRenderer3D();
StandardCategoryToolTipGenerator tt = new StandardCategoryToolTipGenerator();
rend.setItemURLGenerator(new StandardCategoryURLGenerator("xy_chart.jsp","series","section"));
rend.setToolTipGenerator(new StandardCategoryToolTipGenerator());
rend.setDrawBarOutline(true);
rend.setItemURLGenerator(new StandardCategoryURLGenerator("xy_chart.jsp","series","section"));
CategoryPlot plot = new CategoryPlot(data, categoryAxis, valueAxis, rend);
JFreeChart chart = new JFreeChart("rr", JFreeChart.DEFAULT_TITLE_FONT, plot, true);
rend = chart.getPlot().getRenderer();
I am sorry about the ignorance,now I am getting error, could you kindly correct my code.
method setRenderer(org.jfree.chart.renderer.category.StackedBarRenderer3D) not found in class org.jfree.chart.plot.Plot
**** JSP***
CategoryAxis categoryAxis = new CategoryAxis("Site");
ValueAxis valueAxis = new NumberAxis("Value");
StackedBarRenderer3D rend = new StackedBarRenderer3D();
StandardCategoryToolTipGenerator tt = new StandardCategoryToolTipGenerator();
rend.setItemURLGenerator(new StandardCategoryURLGenerator("xy_chart.jsp","series","section"));
rend.setToolTipGenerator(new StandardCategoryToolTipGenerator());
rend.setDrawBarOutline(true);
CategoryPlot plot = new CategoryPlot(data, categoryAxis, valueAxis, rend);
JFreeChart chart = new JFreeChart("rr", JFreeChart.DEFAULT_TITLE_FONT, plot, true);
chart.getPlot().setRenderer(rend);
method setRenderer(org.jfree.chart.renderer.category.StackedBarRenderer3D) not found in class org.jfree.chart.plot.Plot
**** JSP***
CategoryAxis categoryAxis = new CategoryAxis("Site");
ValueAxis valueAxis = new NumberAxis("Value");
StackedBarRenderer3D rend = new StackedBarRenderer3D();
StandardCategoryToolTipGenerator tt = new StandardCategoryToolTipGenerator();
rend.setItemURLGenerator(new StandardCategoryURLGenerator("xy_chart.jsp","series","section"));
rend.setToolTipGenerator(new StandardCategoryToolTipGenerator());
rend.setDrawBarOutline(true);
CategoryPlot plot = new CategoryPlot(data, categoryAxis, valueAxis, rend);
JFreeChart chart = new JFreeChart("rr", JFreeChart.DEFAULT_TITLE_FONT, plot, true);
chart.getPlot().setRenderer(rend);