0

Column color in bar chart

asked 2011-11-02 13:49:37 +0800

bricecol gravatar image bricecol
43 4

Hi.

I would like to paint each column of my bar chart with a different color, is it possible ?
I created a JFreeChartEngine and I know how to color a serie but not a column :(

private class Engine extends JFreeChartEngine
  {
    public boolean prepareJFreeChart(JFreeChart jfchart, Chart chart)
    {
      CategoryPlot plot = (CategoryPlot) jfchart.getPlot();

      BarRenderer3D renderer = (BarRenderer3D) plot.getRenderer();

      Color[] colors = App.getDefaultChartColors();

      renderer.setSeriesPaint(0, colors[0]);
      
      return false;
    }
  }

delete flag offensive retag edit
Be the first one to reply this discussion!
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow

RSS

Stats

Asked: 2011-11-02 13:49:37 +0800

Seen: 276 times

Last updated: Nov 02 '11

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More