Hello all,
I'm facing a problem.
I would like to see the background of my chart (which actually is Grey) in White.
I just can't find a way to do it ?
Can, please, anybody help me on that topic ?
Thanks by Advance
C.
chart.ChartArea.ForeGroundColor = Color.Blue;
// CML: Chart management ...
// ... Add a new chart worsheet to workbook
Spire.Xls.Chart chart = xlSheet.Charts.Add();
chart.ChartType = ExcelChartType.Line;
chart.DisplayBlanksAs = ChartPlotEmptyType.Zero;
// ... Set region of chart data
chart.DataRange = xlSheet.Range["A" + (firstDataRowIndex-1) + ":C" + (rowNumber-1)];
chart.SeriesDataFromRange = false;
// ... Set position of chart
chart.LeftColumn = 1;
chart.TopRow = rowNumber + 1;
chart.RightColumn = 5;
chart.BottomRow = rowNumber + 21;
// ... Set the background color of the chart
chart.ChartArea.ForeGroundColor = System.Drawing.Color.White;
// ... Chart title
chart.ChartTitle = "Reussite".Equals(lstAnalyse.Items[i].Value) ?
EXPORT_ANALYSIS_SUCCESS :
EXPORT_ANALYSIS_FAILURE;
chart.ChartTitleArea.IsBold = true;
chart.ChartTitleArea.Size = 10;
// X axis
chart.PrimaryCategoryAxis.Font.IsBold = false;
chart.PrimaryCategoryAxis.Font.Size = 6;
// ... ... Main
chart.PrimaryCategoryAxis.Title = "Mois / Month";
chart.PrimaryCategoryAxis.TitleArea.Size = 8;
chart.PrimaryCategoryAxis.TitleArea.IsBold = true;
// ... ... Sub
chart.PrimaryCategoryAxis.TextRotationAngle = 90;
// Y axis
chart.PrimaryValueAxis.Font.IsBold = false;
chart.PrimaryValueAxis.Font.Size = 6;
chart.PrimaryValueAxis.HasMajorGridLines = true;
// ... ... Main
chart.PrimaryValueAxis.Title = "Pourcentage / Percent";
chart.PrimaryValueAxis.TitleArea.Size = 8;
chart.PrimaryValueAxis.TitleArea.IsBold = true;
chart.PrimaryValueAxis.TitleArea.TextRotationAngle = 90;
// CML: Sets line options (weigth and color)
for (int j = 0; j < chart.Series.Count; j++)
{
chart.Series[j].Format.LineProperties.Weight = ChartLineWeightType.Wide;
chart.Series[j].Format.LineProperties.Color = SpireXlsHelper.CURVES_COLORS_ROTATE[j];
}
chart.Legend.Position = LegendPositionType.Top;
chart.PlotArea.ForeGroundColor = System.Drawing.Color.Aqua;