Spire.Presentation is a professional PowerPoint® compatible library that enables developers to create, read, write, modify, convert and Print PowerPoint documents from any .NET(C#, VB.NET, ASP.NET, .NET Core) application and Java (J2SE and J2EE) application.

Thu Sep 05, 2019 12:56 pm

Hi team

1. How can we update or change custom values for "chart.Categories.CategoryLabels" one by one? please provide code in VB.NET

2. also how can we refer chart data which comes in excel when we click right button on a chart in ppt and a excel sheet open which having data for chart..how can we update values in this excel for chart data and how can we use this updated data from for our chart.. please provide code in VB.NET.

Thanks in advance.
Looking for a positive response.


Thanks & Regards,
Anil Kumar

anilbits001
 
Posts: 41
Joined: Thu Sep 05, 2019 12:50 pm

Fri Sep 06, 2019 12:06 pm

Hi,

Thanks for your inquiry.
1. You could set the custom values of charts first, then write these values into CategoryLabels. Please refer to the following code.

Code: Select all
                'Set the custom values of charts
                chart.ChartData(1, 0).Text = "Text1"
                chart.ChartData(2, 0).Text = "Text2"
                chart.ChartData(3, 0).Text = "Text3"
                chart.ChartData(4, 0).Text = "Text4"

                'Write these values into CategoryLabels
                chart.Categories.CategoryLabels = chart.ChartData(1, 0, 4, 0)


2. When you update the data of the chart table in PowerPoint file, the data in Excel sheet will update automatically, below is the code for your reference.

Code: Select all
                Dim chart As IChart = CType(ppt.Slides(0).Shapes(0), IChart)
                chart.ChartData(1, 1).Value = 100


If the code couldn’t solve your issue, to help us investigate your issue accurately, please offer us your input file and the desired result file.

Best wishes,
Amber
E-iceblue support team
User avatar

Amber.Gu
 
Posts: 525
Joined: Tue Jun 04, 2019 3:16 am

Wed Oct 30, 2019 6:57 am

Hi,

Greetings from E-iceblue.
Have you tried the code I offered you last time? Does it solve your issue?
Could you please give us some feedback at your convenience?

Best wishes,
Amber
E-iceblue support team
User avatar

Amber.Gu
 
Posts: 525
Joined: Tue Jun 04, 2019 3:16 am

Fri Nov 15, 2019 12:23 pm

Hi Amber,

Apologies for late reply.

yes, I have tried it and it worked for me . thanks a lot you your quick help.


Thanks & Regards,
Anil Kumar

anilbits001
 
Posts: 41
Joined: Thu Sep 05, 2019 12:50 pm

Mon Nov 18, 2019 1:19 am

Hi,

Thanks for your feedback.
Any question, welcome to contact us. Have a nice day.

Best wishes,
Amber
E-iceblue support team
User avatar

Amber.Gu
 
Posts: 525
Joined: Tue Jun 04, 2019 3:16 am

Return to Spire.Presentation