Last active
December 28, 2019 16:03
-
-
Save aspose-com-gists/322d1ede29e94f5536291ce0d2dc1efe to your computer and use it in GitHub Desktop.
Aspose.Slides for Java - Sunburst and Treemap Charts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Presentation pres = new Presentation(); | |
try { | |
IChart chart = pres.getSlides().get_Item(0).getShapes().addChart(ChartType.Sunburst, 50, 50, 500, 400); | |
//... | |
pres.save("./Sunburst.pptx", SaveFormat.Pptx); | |
} finally { | |
pres.dispose(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Presentation pres = new Presentation(); | |
try { | |
IChart chart = pres.getSlides().get_Item(0).getShapes().addChart(ChartType.Treemap, 50, 50, 500, 400); | |
//... | |
pres.save("./Sunburst.pptx", SaveFormat.Pptx); | |
} finally { | |
pres.dispose(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Presentation pres = new Presentation(); | |
try { | |
IChart chart = pres.getSlides().get_Item(0).getShapes().addChart(ChartType.Sunburst, 50, 50, 500, 400); | |
IChartDataPointCollection dataPoints = chart.getChartData().getSeries().get_Item(0).getDataPoints(); | |
IDataLabel branch1Label = dataPoints.get_Item(0).getDataPointLevels().get_Item(0).getLabel(); | |
branch1Label.getDataLabelFormat().setShowCategoryName(false); | |
branch1Label.getDataLabelFormat().setShowSeriesName(true); | |
branch1Label.getDataLabelFormat().getTextFormat().getPortionFormat().getFillFormat().setFillType(FillType.Solid); | |
branch1Label.getDataLabelFormat().getTextFormat().getPortionFormat().getFillFormat().getSolidFillColor().setColor(Color.YELLOW); | |
IFormat steam4Format = dataPoints.get_Item(9).getDataPointLevels().get_Item(1).getFormat(); | |
steam4Format.getFill().setFillType(FillType.Solid); | |
steam4Format.getFill().getSolidFillColor().setColor(new Color(0, 176, 240, 255)); | |
pres.save("./Sunburst.pptx", SaveFormat.Pptx); | |
} | |
finally { | |
pres.dispose(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Presentation pres = new Presentation(); | |
try { | |
IChart chart = pres.getSlides().get_Item(0).getShapes().addChart(ChartType.Sunburst, 50, 50, 500, 400); | |
IChartDataPointCollection dataPoints = chart.getChartData().getSeries().get_Item(0).getDataPoints(); | |
IDataLabel branch1Label = dataPoints.get_Item(0).getDataPointLevels().get_Item(0).getLabel(); | |
branch1Label.getDataLabelFormat().setShowCategoryName(false); | |
branch1Label.getDataLabelFormat().setShowSeriesName(true); | |
branch1Label.getDataLabelFormat().getTextFormat().getPortionFormat().getFillFormat().setFillType(FillType.Solid); | |
branch1Label.getDataLabelFormat().getTextFormat().getPortionFormat().getFillFormat().getSolidFillColor().setColor(Color.YELLOW); | |
pres.save("./Sunburst.pptx", SaveFormat.Pptx); | |
} | |
finally { | |
pres.dispose(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment