Spire.Presentation is a professional PowerPoint® compatible library that enables developers to create, read, write, modify, convert and Print PowerPoint documents. Get free and professional technical support for Spire.Presentation for .NET, Java, Android, C++, Python.

Mon Jul 04, 2022 7:25 pm

Problem:
To create a scatter chart like the one below I have used the "Values from cell" property to show the data point labels.

Scatter chart with labels.PNG


How can I do this using spire.presentations?

Here's my pptx with a scatter chart.

Scatter chart.zip

majeed_s
 
Posts: 80
Joined: Thu Mar 25, 2021 4:13 pm

Tue Jul 05, 2022 9:01 am

Hi,

Thank you for your inquiry.
Please refer to the .cs file I have attached to achieve your requirement. If you have any questions, please feel free to contact us.

Sincerely,
Kylie
E-iceblue support team
User avatar

kylie.tian
 
Posts: 412
Joined: Mon Mar 07, 2022 2:30 am

Wed Jul 06, 2022 12:58 pm

Thank you for sharing the CS file.

Can I please ask you to double check the CS file? Looks like its trying to solve a completely different problem.

In a scatter chart, to show the label names of the data points, people use the "Values from cell" feature to show it in the data label. Not sure if your CS code does that?

majeed_s
 
Posts: 80
Joined: Thu Mar 25, 2021 4:13 pm

Thu Jul 07, 2022 6:09 am

Hi,

Thank you for your reply.
Yes, my .cs file contains the feature you want. We are providing the DataLableRanges method to set the value of the data label from the cell. Please refer to the code below.
Code: Select all
            //Set data labels value from the cells
            chart.Series[0].DataLabelRanges = chart.ChartData["C2", "C7"];
            //Show data labels range
            dataLabel1.ShowDataLabelsRange = true;


Sincerely,
Kylie
E-iceblue support team
User avatar

kylie.tian
 
Posts: 412
Joined: Mon Mar 07, 2022 2:30 am

Thu Jul 07, 2022 3:18 pm

Again, apologies if I am being stupid, but in the CS code there is no reference to a chart object and no reference to a presentation.

The code is for a word doc and trying to do something with track changes.

Can you please check the CS file and upload the correct one?

majeed_s
 
Posts: 80
Joined: Thu Mar 25, 2021 4:13 pm

Fri Jul 08, 2022 1:36 am

Hi,

Sorry for the inconvenience caused, here I attached my .cs file again.

Sincerely,
Kylie
E-iceblue support team
User avatar

kylie.tian
 
Posts: 412
Joined: Mon Mar 07, 2022 2:30 am

Thu Jul 14, 2022 4:12 pm

All sorted! Thanks a lot.

majeed_s
 
Posts: 80
Joined: Thu Mar 25, 2021 4:13 pm

Fri Jul 15, 2022 1:22 am

Hi,

You're welcome !
If you need assistance in the future, please don't hesitate to contact us.
Wish you all the best :D

Sincerely,
Kylie
E-iceblue support team
User avatar

kylie.tian
 
Posts: 412
Joined: Mon Mar 07, 2022 2:30 am

Return to Spire.Presentation