We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Need to save/access the SolidFillColor(format) of every series in the chart

Hi Mudassir,

I have a chart in a pptx file. I need to save the fillformat,fillcolor etc. of every series of the chart. Later on I clear the series and categories data collection and add fresh data to the chart. Once that is done I need to apply the saved fillformat,fillcolour etc. again to the series.

I tried using the following code to get the series colour, but when I inspect 'cs.getFormat().getFill().getSolidFillColor().getColor()' the value contained is java.awt.Color[r=0,g=0,b=0].

ChartSeriesExCollection seriesExCol = chart.getChartData().getSeries();
Iterator<?> itr = seriesExCol.iterator();
while (itr.hasNext()) {
ChartSeriesEx cs = (ChartSeriesEx) itr.next();
SeriesFormatDO seriesFormatDO = new SeriesFormatDO();
seriesFormatDO.setFillType(cs.getFormat().getFill().getFillType());
seriesFormatDO.setSolidFillColor(cs.getFormat().getFill().getSolidFillColor().getColor());
seriesFormat.add(seriesFormatDO);
}

Kindly guide me to save and later apply all the cosmetic properties of the chart.

Thanks,
Gaurang.

Hi Gaurang,

I have observed the requirements shared and have worked with the presentation file on my end. Actually, the issue is not related to Aspose.Slides. The template chart is using Automatic fill color and fill type which is not recognized by Aspose.Slides. I have also created an issue with ID SLIDESJAVA-34330 in our issue tracking system to further investigate and resolve the issue that why automatic fill colors for chart series are not read.

In the mean while, I suggest you to please set the solid fill type for chart series collection and their respective colors. Then when you try to access the color and fill types, you will get the right values. I have also attached the modified presentation and suggest you to please try accessing chart on slide 2.

Many Thanks,

The issues you have found earlier (filed as SLIDESJAVA-34330) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.