Frage

I am using ICEfaces 3.2. I want to know how to change the color of the ICEfaces ace pieChart slices.

My JSF code is as below:

<ace:chart id="chart" value="#{piechartbean.pieData}"
  animated="true"  legend="true"
  widgetVar="pieChart"/>

I want to provide my own color for each slices of the pie chart. My bean code is as below:

public List<SectorSeries> getPieData() {
  SectorSeries series = new SectorSeries();
  series.add("PENDING", map.get("PENDING"));
  series.add("SUBMITTED", map.get("SUBMITTED"));
  series.add("ARCHIVED", map.get("ARCHIVED"));
  series.setShowDataLabels(true);
  series.setSliceMargin(4);
  series.setFill(true);
  pieData.add(series) ;
  return pieData;
}
War es hilfreich?

Lösung

SectorSeries is a subclass of ChartSeries which has the property String[] seriesColors. This can be used to define an array of CSS color definitions for use by the renderer. This solution i got from Icesoft forum.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top