Line chart in aspose slide

Hi Team,

I have a requirement to create clustered column chart with which include one line series for total.

I have used two series of type ChartTypeEx.ClusteredColumn and one series of ChartTypeEx.Line Type. Chart is getting plotted fine.

Could you please help me to format the line series like color of the line,thickness of the line and formatting the label text of line series.

Any sample code will be more helpfull.

Clustered columns are ploted on left Y-axis and line series is ploted on the aditional y-axis.

Please find the attached file for better understanding.



Hi Sushanta,

Thank you for the details.

Please check the following sample code for formatting of line series in your chart.

//Setting fill color for series
series.Format.Line.Style = LineStyleEx.ThickThin;
series.Format.Line.FillFormat.FillType = FillTypeEx.Solid;
series.Format.Line.FillFormat.SolidFillColor.Color = Color.Black;
series.MarkerFill.Fill.FillType = FillTypeEx.Solid;
series.MarkerFill.Fill.SolidFillColor.Color = Color.White;
series.MarkerSymbol = MarkerStyleTypeEx.Circle;

Also, to set the formatting of data labels, please check the following code sample and modify it according to your requirement.

//first label will be show Category name
DataLabelEx lbl = new DataLabelEx(series);
lbl.Id = 0;
lbl.ShowCategoryName = true;

PortionEx LabelPortion0 = new PortionEx();
LabelPortion0.PortionFormat.FontHeight = 12;
LabelPortion0.PortionFormat.FillFormat.FillType = FillTypeEx.Solid;
LabelPortion0.PortionFormat.FillFormat.SolidFillColor.Color = Color.White;

//Setting Text
LabelPortion0.Text = series.Values[0].Value.ToString();
lbl.TextFrame.Text = " ";
lbl.Format.Fill.FillType = FillTypeEx.Solid;
lbl.Format.Fill.SolidFillColor.Color = Color.Black;


In case you need any further assistance, please feel free to contact us.

Thanks & Regards,