Updating Second Chart on Same Slide

Hi,



I modified the below to find & modify the chart data on an existing presentation:



If TypeOf shape Is IChart Then



Dim chart As IChart = DirectCast(shape, IChart)



Dim defaultWorksheetIndex As Integer = 0



Dim fact As IChartDataWorkbook = chart.ChartData.ChartDataWorkbook



Dim Series As IChartSeries = Chart.ChartData.Series(0)



Series.DataPoints(0).Value.Data = 23

Series.DataPoints(1).Value.Data = 99

Series.DataPoints(2).Value.Data = 47

Series.DataPoints(3).Value.Data = 73

Series.DataPoints(4).Value.Data = 18



End If



My issue is I now have 2 Bar Charts on the same slide and am unable to capture the second Chart to update the excel data, and cannot find this in the documentation.



Can you advise how?



Thanks



Tony

Hi Tony,


I have observed your requirements. I request you to please share the source presentation so that we may investigate on our end to assist you.

Best Regard,

Hi,



Please find presentation attached, I am trying to update the bottom right chart on 3rd Slide



Tony

Hi Tony,

I like to share that the charts are also considered shapes when working with Aspose.Slides. Each slide can have theoretically as many charts as it can have. When you have multiple charts on a slide, you need to use Alternative text property to give name to charts and distinguishing different charts. Like in your case, you need to set the Alternative text property for two charts as given in links below.

Screenshot by Lightshot
Screenshot by Lightshot

You can then use this documentation article to find the desired shape and then perform desired action on that.

Many Thanks,

Hi,



Thanks for the feedback which works perfect



Regards



Tony