# How to Create Charts in Presentations Using Java

> Learn how to create charts in PowerPoint PPT, PPTX and ODP presentations in Java with Aspose.Slides using both legacy and modern chart APIs.

Source: https://docs.aspose.com/slides/java/how-to-create-charts-in-a-presentation/
Updated: 2026-08-13


{{% alert color="info" %}} 

A new [Aspose.Slides for Java API](https://docs.aspose.com/slides/java/) has been released and now this single product supports the capability to generate PowerPoint documents from scratch and editing the existing ones.

{{% /alert %}} 
## **Support for Legacy Code**
In order to use the legacy code developed with Aspose.Slides for Java versions earlier to 14.x.x, you need to make some minor changes in your code and the code will work as earlier. All the classes that were present in old Aspose.Slides for Java under com.aspose.slides and com.aspose.slides.pptx namespaces are now merged in single com.aspose.slides namespace. Please take a look over the following simple code snippet for creating a normal chart from scratch in presentation using legacy Aspose.Slides API and follow the steps describing how to migrate to new merged API.
## **Legacy Aspose.Slides for Java Approach**
{{< gist "aspose-com-gists" "1f55f0222bc39a382d831900e8de7400" "Examples-src-main-java-com-aspose-slides-examples-Slides-Charts-CreateChartEx-CreateChartEx.java" >}}
## **New Aspose.Slides for Java 14.x.x Approach**
{{< gist "aspose-com-gists" "1f55f0222bc39a382d831900e8de7400" "Examples-src-main-java-com-aspose-slides-examples-Slides-Charts-CreateAChart-CreateAChart.java" >}}

Please take a look over the following simple code snippet for creating a scatterd chart from scratch in presentation using legacy Aspose.Slides API and how to achieve it with new merged API.
## **Legacy Aspose.Slides for Java Approach**
{{< gist "aspose-com-gists" "1f55f0222bc39a382d831900e8de7400" "Examples-src-main-java-com-aspose-slides-examples-Slides-Charts-ExistingChart-ExistingChart.java" >}}
## **New Aspose.Slides for Java 14.x.x Approach**
{{< gist "aspose-com-gists" "1f55f0222bc39a382d831900e8de7400" "Examples-src-main-java-com-aspose-slides-examples-Slides-Charts-CreateScatterChart-CreateScatterChart.java" >}}



## Related articles

- [How to Add Headers & Footers to Presentations in Java](https://docs.aspose.com/slides/java/how-to-add-header-footer-in-a-presentation/)
- [How to Create Hello World Presentations in Java](https://docs.aspose.com/slides/java/how-to-create-hello-world-presentation-document/)
- [Migration from Earlier Versions](https://docs.aspose.com/slides/java/migration-from-earlier-versions-of-aspose-slides-for-java/)