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

Free Support Forum - aspose.com

Setting chart style doesn't work


We are trying to set chart style using Style property, but it doesn’t seem to work at all. It looks like the row chart.Style := 5; does nothing to resulting file.

The code looks as foolows:

Workbook workbook1 = new Workbook(FileFormatType.Xlsx);
Worksheet sheet = workbook1.Worksheets[0];

Cells cells = sheet.Cells;
cells[1, 0].PutValue(“Company A”);
cells[2, 0].PutValue(“Company B”);
cells[3, 0].PutValue(“Company C”);
cells[0, 1].PutValue(2008);
cells[0, 2].PutValue(2009);
cells[0, 3].PutValue(2010);
cells[1, 1].PutValue(10000);
cells[2, 1].PutValue(20000);
cells[3, 1].PutValue(30000);
cells[1, 2].PutValue(15000);
cells[2, 2].PutValue(25000);
cells[3, 2].PutValue(35000);
cells[1, 3].PutValue(18000);
cells[2, 3].PutValue(28000);
cells[3, 3].PutValue(38000);

int chartIndex = sheet.Charts.Add(ChartType.BarStacked, 9, 9, 21, 15);

Chart chart = sheet.Charts[chartIndex];
chart.NSeries.Add("$B$2:$D$4", false);
chart.NSeries.CategoryData = “$B$1:$D$1”;

chart.Title.Text = “Sale”;
chart.Style = 5;

Could someone take a look and feedback why it doesn’t work?

Thank you in advance!


Thanks for your posting and using Aspose.Cells.

It seems, this feature is not supported for 3D Pie charts. But for other charts like Column, it works fine.

We have logged this issue in our database for investigation and for a fix. Once, there is some news for you relating to it, we will let you know asap.

This issue has been logged as

  • CELLSNET-45422 - Style property of Chart for 3D Pie does not work


Thanks for using Aspose.Cells.

Please try the following code and it should fix your issue. Let us know your feedback.

chart.Legend.Position = LegendPositionType.Bottom;
chart.Elevation = 30;


The code above changes the legend position and chart elevation.

What we need is fully apply chart style, which affects not only legend position and elevation, but also pie colors (it adds gradients and better visual representation). Please see the image attached for more details.


Thanks for your feedback and using Aspose.Cells.

We understand your point and logged it in our database for product team further consideration. Once, there is some update for you, we will let you know asap. Besides, if we decided to implement this feature, we will log a New Feature request for this issue to implement it in our future releases.


Thanks for using Aspose.Cells.

We think, style has been applied properly. Please provide us your actual output Excel file (generated by Aspose.Cells) and expected Excel file (created by MS-Excel manually) for a reference. We will look into this issue further and help you asap. Thanks for your cooperation in this regard and have a good day.