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

Free Support Forum - aspose.com

Need help editing chart (OleObjectFrameEx vs ChartEx)

I need to search for charts within a presentation and then edit them. By ‘edit’ I mean change the data values.

I am able to get the shape by searching for AlternativeText. However, I can’t cast the shape into a ChartEx object.

Can you provide some help? Also, this example claims to show how to do this, but I think it is adding a chart to a slide, not editing an existing chart: http://www.aspose.com/docs/display/slidesnet/Updating+an+Existing+Chart

Finally, I want to do this using only Aspose Slides; I do not want to purchase Cells.

Thanks for your help!

Hi Jonathan,

Thanks for inquiring Aspose.Slides.

I have observed the requiremnt shared and like to add that Aspose.Slides allows you to access the MSO charts added with in presentation. Please share the sample presentation and code sample that you are using to access the chart. I will investigate the issue on my end to help you further.

Many Thanks,

Here’s my code:

           //Instantiate PresentationEx class that represents PPTX file
PresentationEx pres = new PresentationEx(“MasterDemoAnalyzerTool.pptx”);
        //Access first slide
        SlideEx sld = pres.Slides[1];
        ChartEx chart = null;

        foreach (ShapeEx s in sld.Shapes)
            if (s.AlternativeText == "chart1")
                chart = s as ChartEx; 
                if (chart != null)
                //Take first chart series
                ChartSeriesEx series = chart.ChartData.Series[0];

Hi Jonathan,

I have worked with the presentation file shared and like to share that it is not an issue with Aspose.Slides. The chart that has been added with Alternative text, “chart 1” is an Ole Object of MS Excel with chart. It is in fact not a chart shape w.r.t Aspose.Slides as it has been created in MS Excel. For more information about MSO charts in Aspose.Slides, please visit this documentation section.

Many Thanks,