Free Support Forum - aspose.com

Unable to set Aspose.Cells ChartArea.Area.BackgroundColor

Received : 2007/10/15 08:18:12
Message : I am currently evaluating your Aspose.Cells product and it has been fairly easy to work with so far. However, I have recently run into an issue I cannot seem to get around.

I am trying to set the background color of a chart (plotarea). What ever I do does not make any change whatever. Here is the code I am using.

workbook.Worksheets[1].Charts.Add(Aspose.Cells.ChartType.Bar, 5, 1, 26, 10);
Excel.Chart chart = workbook.Worksheets[1].Charts[0];
chart.NSeries.Add("=Data!A1:B5", true);//AB1:AC10
chart.Type = Aspose.Cells.ChartType.Line;
chart.NSeries.CategoryData = "=Data!$A$1:$A$5";
chart.PlotArea.Border.IsVisible = false;
chart.SeriesAxis.IsVisible = false;
chart.MajorGridLines.IsVisible = false;
chart.PlotArea.Area.BackgroundColor = Color.Red;


This message was posted using Aspose.Live 2 Forum

Hi,

Thanks for considering Aspose.

please change a line in the code with:

chart.PlotArea.Area.ForegroundColor = Color.Red;

Thank you.

Try using this. I ran into this same problem and it seemed to fix it.

chart.PlotArea.Area.ForeGroundColor = Color.Red;

Sorry, didn’t see that it was already posted.