package com.aspose.slides.examples.Slides.Charts; import com.aspose.slides.ChartType; import com.aspose.slides.IChart; import com.aspose.slides.Presentation; import com.aspose.slides.SaveFormat; import com.aspose.slides.examples.Utils; public class DisplayChartLabelsAsCallouts { public static void main(String[] args) { // The path to the documents directory. String dataDir = Utils.getDataDir(DisplayChartLabelsAsCallouts.class); // Instantiate Presentation class that represents PPTX file Presentation pres = new Presentation(); try { IChart chart = pres.getSlides().get_Item(0).getShapes().addChart(ChartType.Pie, 50, 50, 500, 400); chart.getChartData().getSeries().get_Item(0).getLabels().getDefaultDataLabelFormat().setShowValue(true); chart.getChartData().getSeries().get_Item(0).getLabels().getDefaultDataLabelFormat().setShowLabelAsDataCallout(true); chart.getChartData().getSeries().get_Item(0).getLabels().get_Item(2).getDataLabelFormat().setShowLabelAsDataCallout(false); pres.save(dataDir + "DisplayCharts.pptx", SaveFormat.Pptx); } finally { if (pres != null) pres.dispose(); } } }