Spire.XLS is a professional Excel API that enables developers to create, manage, manipulate, convert and print Excel worksheets. Get free and professional technical support for Spire.XLS for .NET, Java, Android, C++, Python.

Mon Sep 28, 2020 7:29 am

Good Morning.

I am working with charts in linear format and I was wondering if there is any way to make the legend of each series instead of appearing in the default positions (top, bottom, right or left), appear attached to each line, that is, a kind of data label. I am trying to put some text manually at a certain point on the graph but I can't.

Thank you.

blastdoman
 
Posts: 27
Joined: Thu Jul 02, 2020 7:06 am

Mon Sep 28, 2020 8:53 am

Hello,

Thanks for your inquiry.
Please visit the following links to learn how to set data labels for charts. If this is not what you want, please provide more details to help us better understand your requirement, such as your input file (if any) and your desired output. Thanks in advance.

- How to set and format data labels for Excel charts in C#
- Custom data labels using values from cells in C#

Sincerely,
Rachel
E-iceblue support team
User avatar

rachel.lei
 
Posts: 1571
Joined: Tue Jul 09, 2019 2:22 am

Mon Sep 28, 2020 9:13 am

I have already more or less achieved what I wanted to do

Code: Select all
chart.Legend.Delete();
ChartSerie cs = chart.Series.Add();
cs.Name = "Series 1";
cs.DataPoints[i].DataLabels.Text = cs.Name;


Thansk for your reply.

blastdoman
 
Posts: 27
Joined: Thu Jul 02, 2020 7:06 am

Mon Sep 28, 2020 9:23 am

Hello,

Glad to hear that!
If you encounter any issues related to our product in the future, just feel free to contact us.
Wish you all the best!

Sincerely,
Rachel
E-iceblue support team
User avatar

rachel.lei
 
Posts: 1571
Joined: Tue Jul 09, 2019 2:22 am

Return to Spire.XLS