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.
ICEfaces pieChart: how to change the slice color?
-
14-01-2022 - |
문제
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;
}
해결책
제휴하지 않습니다 StackOverflow