We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Convert Total Series to Line Chart and Display its Values on Above Position

Convert Total Series to Line Chart and Display its Values on Above Position


This Topic is created by shakeel.faiz using the Email to Topic plugin.

Hi,

Thanks for using Aspose.Cells.

Please see the following sample code. Its source Excel file and its output Excel file. The code shows, how to convert the Total series into Line chart and shows its values on the above position.

Sample-and-Output-Excel-Files.zip

C#

//Load sample workbook
Workbook wb = new Workbook(dirPath + “sample.xlsx”);

//Access first worksheet
Worksheet ws = wb.Worksheets[0];

//Access first chart
Chart ch = ws.Charts[0];

//Access total series
Series srs = ch.NSeries.GetSeriesByOrder(3);

//Change its type to line chart
srs.Type = ChartType.Line;

//Show its values on above position
srs.DataLabels.ShowValue = true;
srs.DataLabels.Position = LabelPositionType.Above;

//Save the workbook
wb.Save(dirPath + “output.xlsx”);