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

Free Support Forum - aspose.com

Chart Legend

How can I update the chart legend text from a chart template ? Let’s say I have 2 Series collection.


Hi,


Thanks for your posting and considering Aspose.Cells.

Please use the following code to fulfill your needs. Let us know your feedback. Please also read the comments inside the code for your more understanding. You can either assign name to series or cell name from which series name will be extracted.

C#
//Change the first Series Name
Chart ch = ws.Charts[0];
Series srs = ch.NSeries[0];
srs.Name = "JmanaLastas ";

//If you want to give cell name, for example
//your new name is present in cell A8
srs.Name = "=A11 ";