Gaining control Sector coloring in JFreechart

ivin jacob
  • ivin jacob

    ivin jacob - 2008-10-22

    Please help in gaining control over the sector coloring in the below code

    DefaultPieDataset pieDataset = new DefaultPieDataset();
    pieDataset.setValue("Green", new Integer(70));
    pieDataset.setValue("Black", new Integer(10));
    pieDataset.setValue("Yellow", new Integer(20));

    • Ulf Dittmer

      Ulf Dittmer - 2008-10-23

      That's really a missing functionality in cewolf. But it's not hard to create a PostProcessor that can set custom colors. I've uploaded one that can do this for pie charts and category plots to; the class file is

      To use it you'd do this in your JSP:

      ChartPostProcessor seriesPaint = new SeriesPaintProcessor();
      pageContext.setAttribute("seriesPaint", seriesPaint);

      and then add this to your cewolf:chart tag:

      <cewolf:chartpostprocessor id="seriesPaint">
              <cewolf:param name="0" value='<%= "#FFFFAA" %>'/>
              <cewolf:param name="1" value='<%= "#AAFFAA" %>'/>
              <cewolf:param name="2" value='<%= "#FFAAFF" %>'/>
              <cewolf:param name="3" value='<%= "#FFAAAA" %>'/>

      I'll add this to the upcoming cewolf release.


    • ivin jacob

      ivin jacob - 2008-10-24

      The Java File URL that you gave is giving

      Apache Tomcat/4.0.3 - HTTP Status 404 - /code/;

    • Ulf Dittmer

      Ulf Dittmer - 2008-11-07

      Remove the extra semicolon at the end and it should work fine.


Log in to post a comment.