Hi,
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;
chart.ToImage(“d:\outbarstacked1.bmp”);
workbook1.Save(“d:\outbarstacked2.xlsx”);
Could someone take a look and feedback why it doesn’t work?
Thank you in advance!