|
chart.Series[0].DataPoints[0].DataFormat.Fill.ForeColor = Color.Green; |
Hello Sridhar,
Thanks for your answer. Actually I tried this approach before asking a question. But here is the problem. I create a chart using the following code:
IChartShape
chart = _currentWorksheet.Charts.Add();
chart.ChartTitle =
string.Format("TEST EXECUTION REPORT ({0})", groupName);
chart.Legend.Position =
ExcelLegendPosition.Bottom;
IChartSerie serie =
chart.Series.Add("Series1", ExcelChartType.PieOfPie);
serie.DataPoints.DefaultDataPoint.DataLabels.IsValue = true;
serie.DataPoints.DefaultDataPoint.DataLabels.IsCategoryName = true;
serie.Values =
_currentWorksheet.Range[tableStartRow, 3, tableStartRow + 4, 3];
serie.CategoryLabels =
_currentWorksheet.Range[tableStartRow, 2, tableStartRow + 4, 2];
Then I save a workbook and open it with excel. There is a proper chart there except of legend colors. But: serie.DataPoints is always an empty collection. So I can't set its color. Could it be they are created when a workbook is saved?
Thanks!
Artem Kliatchkine