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

Free Support Forum - aspose.com

Updating chart in word document

Hey

I am creating a report and as part of the report we have to show few charts. I am working of a template doc and it has sample editable pie/bar charts.

I try to find the chart and then update the values with the report values. However the chart color is changed from the template doc.

The same doesn't happend when I create a pptx report . The updated charts take the color of the template file. However for ppt I could get the workbook of the chart and update the values of the excel.

For word document i couldnt get the workbook of the editable chart. Why is this so? I am trying for past few days. Any help would be great.

Thanks

public

Aspose.Words.Drawing.Charts.Chart FindChart(Document document, string chartName)

{var shapes = document.GetChildNodes(NodeType.Shape, true).ToArray();

foreach(Shape shape in shapes)

{

if(shape.HasChart)

{

if(shape.Name == chartName){

return shape.Chart ;}

}}return null;}

//updating values of bar chart

var ch = this.FindChart(document, chartName);

var seriesCol = ch.Series;

seriesCol.Add(previousYear, ab, pv);

seriesCol.Add(currentYear, ab, cv);

I want to set the bar colors.

Thank you

Hi Latha,

Thanks for your inquiry. Unfortunately, Aspose.Words does not support the requested feature at the moment. However, we have logged this feature request as WORDSNET-12640 to set/get chart series color in our issue tracking system. You will be notified via this forum thread once this feature is available.

We apologize for your inconvenience.

The issues you have found earlier (filed as WORDSNET-12640) have been fixed in this Aspose.Words for .NET 21.6 update and this Aspose.Words for Java 21.6 update.