円グラフをExcelでエクスポートする必要があります。エクスポートはこれまで機能していますが、チャートの色の一部は同じです。問題を理解できません。
コードは次のとおりです。
Color[] c = this.createRainbow(100);
int n = chart.getDataPointCount(0); //number of Pies
ArrayList<Integer> compare = new ArrayList<Integer>();
for (int j = 0; j < n && !ValueWatcherServer.canceled_id.contains(connectionid); j++) {
int rePos = (int)(((double)j / (double)n * (double)c.length));
ChartFormat format = chart.getDataPointFormat(0, j);
format.setSolid();
if(!compare.contains(rePos)){
compare.add(rePos);
format.setForeColor(c[rePos].getRGB());
}
else{
format.setForeColor(3);
}
chart.setDataPointFormat(0, j, format);
}
結果は次のとおりです。