Change the color of the line chart series in Excel file using Aspose.Cells for .NET in C#

How to change the color of the line chart series in c#. I have multiple series line chart and I have to customize the series colour. Please suggest me what to do?

Hi,


Thanks for your query.

Well, I think you may try to use Series.Border attribute, see the sample code segment below for your reference:
e.g
Sample code:

//Set the attributes for a series line
Series aseries;
aseries = chart.NSeries[0];
Line line = aseries.Border;
line.DashType = MsoLineDashStyle.DashDot;
line.CapType = LineCapType.Square;
line.Color = Color.Green;
line.IsVisible = true;
line.Style = LineType.Solid;
line.Weight = WeightType.WideLine;

Hope, this helps a bit.

Thank you.