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

Free Support Forum - aspose.com

Java Code to Change Pie Chart Colors in Word Document | Chart Series Colors

I have created a pie chart with 4 segments but cannot change the default colors. Both AsposeSlides and Aspose.Cells change chart colors easily. Please send sample code.

Sample code:
Shape shape = builder.insertChart(ChartType.PIE, 200, 125);
Chart chart = shape.getChart();
chart.getTitle().setShow(false);

// Delete default generated series.
chart.getSeries().clear();

// Add new series
ChartSeries series0 = chart.getSeries().add(“S0”, new String[] { “High”, “Significant”, “Moderate”, “Low” }, new double[] { 4, 3, 2, 1});

I am able to change the chartDataLabel functions to change all appearance except color

Thanks,
Barbara

@bhpaltiel,

To ensure a timely and accurate response, please ZIP and attach the following resources here for testing:

  • Your simplified input Word document
  • Your expected DOCX file showing the desired output. You can create this document by using MS Word.
  • Please also list the complete steps that you performed in MS Word to create the expected document on your end

As soon as you get these pieces of information ready, we will start investigation into your scenario and provide you code to achieve the same by using Aspose.Words. Thanks for your cooperation.

Thank you for your quick response.

Attached is the information requested.BHP_PieChart.zip (27.6 KB)

Please let me know if you need any further information.

Barbara Paltiel

@bhpaltiel,

We have logged your requirement in our issue tracking system. Your ticket number is WORDSNET-20023. We will further look into the details of this requirement and will keep you updated on the status of the linked issue. Sorry for the inconvenience.

Good morning,
Do you have any further information on this problem? Or suggestions for a work-around?
Thanks,
Barbara

@bhpaltiel,

Your issue (WORDSNET-20023) is currently ‘pending for analysis’ and is in the queue. We will inform you via this thread as soon as this issue will be resolved or any further updates may be available in future. We apologize for your inconvenience.

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