Free Support Forum - aspose.com

Editable Chart Export in PPT

Hi Team,

Recently we had explored aspose.cells.net and purchased licensed version and successfully running in our server…
Currently we have another scenario - need to download charts from UI in ppt. But the check is chart should be editable one in ppt with it’s data and not as image…
Is aspose.slides support this editable charts in ppt?

Regards,
Kalaiselvan R

@kalai328,
Thank you for the query. Yes, Aspose.Slides supports the editable charts. Please take a look at the following simple code example (C#):

using (var presentation = new Presentation())
{
    ISlide slide = presentation.Slides[0];
    IChart chart = slide.Shapes.AddChart(ChartType.ClusteredColumn, 20, 20, 600, 300);

    // change data and formatting here

    presentation.Save(dataPath + "example.ppt", SaveFormat.Ppt);
}

Documents: Create Chart, PowerPoint Charts, Chart Formatting
API Reference: ShapeCollection.AddChart Method, ChartType Enumeration

Hey Andrey,

Yes - Its known that Charts can be edited and formatted before binding into PPT.

But my concern is - After Downloading Chart content into PPT with data.
In PPT - is there a way to edit chart based on data? - Like this customized Chart in PPT is able to be downloaded through aspose.slides.net?

Regards,
Kalaiselvan R

@kalai328,
To clarify your requirements, could you describe more details, please?

@Andrey_Potapov:

From UI - we have set of Charts in each section. (Ex: Section1 - Line Chart, Section2 - Bar Chart, Section3 - Pie Chart, Section4 - Sunburst Chart).
UI its bind thru - API’s with Json Data for each Section Chart.

  1. Have a Requirement - To Export these Charts into PPT
  2. Where the PPT - should not be a image copy - Its should be a Chart (So the same chart Component need to be created in .net API and exported to PPT, Know that few chart types will wont support).
  3. And this PPT chart need to be exported with Data (JSON or Object or Table or Excel). So that user can download the PPT and can able to play with data to modify chart component.

Hope the above content will be helpful - And let me know if any more details required.

Regards,
Kalaiselvan R

@kalai328,
Aspose.Slides adds charts to presentations as PowerPoint elements that are not images. Chart data is stored in an embedded Excel table. So your users can open these presentations and change chart data for their purposes.

Thanks @Andrey_Potapov for the confirmation…
And hope it suits my requirements…

Can you help me to share any sample code for bar or line chart which adds to presentation through .net c#.

I had downloaded latest Aspose.Slides .net DLL for trial purpose…

@kalai328,
The code example below shows adding Line chart and Stacked Bar chart:

using (var presentation = new Presentation())
{
    ISlide firstSlide = presentation.Slides[0];
    ISlide secondSlide = presentation.Slides.AddClone(firstSlide);

    IChart lineChart = firstSlide.Shapes.AddChart(ChartType.Line, 20, 20, 600, 300);
    IChart barChart = secondSlide.Shapes.AddChart(ChartType.StackedBar, 20, 20, 600, 300);

    presentation.Save(dataPath + "example.pptx", SaveFormat.Pptx);
}

More examples you can find by the links above.