如何在PowerPoint中创建动画饼图

PowerPoint logo

Charts are great for visualizing data. Adding animation to charts can make that visualization even better, letting you do things like introduce one piece of a pie chart at a time, so you have more room for discussion. Here’s how to do just that in Microsoft PowerPoint.

图表非常适合可视化数据。 在图表中添加动画可以使可视化效果更好,使您可以进行诸如一次引入一张饼图的操作,因此您有更多的讨论空间。 这是在Microsoft PowerPoint中执行此操作的方法。

在PowerPoint中动画饼图 (Animating a Pie Chart in PowerPoint)

First, open up your PowerPoint presentation and go to the slide where you want the animated pie chart. To insert a pie chart, switch to the “Insert” tab and click the “Chart” button.

首先,打开PowerPoint演示文稿,然后转到需要动画饼图的幻灯片。 要插入饼图,请切换到“插入”选项卡,然后单击“图表”按钮。

Insert pie chart

In the Insert Chart window that appears, select “Pie” from the list on the left. On the right, select the pie chart style you’d like to use from the five options that appear. When you’ve made your selection, click “OK” at the bottom right of the window.

在出现的“插入图表”窗口中,从左侧列表中选择“饼图”。 在右侧,从出现的五个选项中选择要使用的饼图样式。 做出选择后,单击窗口右下方的“确定”。

Select pie chart

You’ll notice the pie chart has now appeared on the slide and, with it, and Excel chart. Change the labels of the pie chart by editing the text in column A, and enter its respective data in column B. Once done, close the spreadsheet.

您会注意到,饼图现在已经出现在幻灯片上,并且与Excel图表一起出现。 通过编辑A列中的文本来更改饼图的标签,然后在B列中输入其相应的数据。完成后,关闭电子表格。

excel sheet

Next, select the pie chart and head over to the “Animations” tab. Here, select whichever animation you’d like to use from the available options. In this example, we will use “Wipe.”

接下来,选择饼图并转到“动画”选项卡。 在这里,从可用选项中选择要使用的动画。 在此示例中,我们将使用“擦拭”。

wipe animation

Next, click the “Animation Pane” to open that up.

接下来,单击“动画窗格”以打开它。

animation pane

The Animation Pane appears to the right of your slide. Here, double-click the animation you added to your pie chart, or click the arrow next to it and then select “Effect Options.”

动画窗格显示在幻灯片的右侧。 在这里,双击添加到饼图中的动画,或单击它旁边的箭头,然后选择“效果选项”。

effect options

A window will appear with effect, timing, and chart animation options. Head over to the “Chart Animation” tab. Here, you can select how the chart animation behaves—as one object or by category. Choosing “As One Object” makes the whole chart appear at once. Choosing “By Category” makes the chart appear one slice at a time, and that’s exactly what we want here.

将出现一个带有效果,时间和图表动画选项的窗口。 转到“图表动画”标签。 在这里,您可以选择图表动画的行为-作为一个对象或按类别。 选择“作为一个对象”会使整个图表立即出现。 选择“按类别”将使图表一次显示一个切片,这正是我们想要的。

You can even decide if you want the animation to begin by drawing the chart background.

您甚至可以通过绘制图表背景来决定是否要开始动画。

by category animation

When you click “OK,” your pie chart will look the same in editing view but hit Shift+F5 to play your slide and then click your left mouse button to watch your new animated pie chart in action.

当您单击“确定”时,饼图在编辑视图中将看起来相同,但是按Shift + F5播放幻灯片,然后单击鼠标左键观看正在运行的新动画饼图。

翻译自: https://www.howtogeek.com/402392/how-to-create-animated-pie-charts-in-powerpoint/

poi 版本 3.17 文件包含 模板 测试main 数据类 需要调整下 路径 /** * @Description: * @Author: xsr * @date : 2018/7/22 9:41 */ public static void makePiePpt(List dataList) throws Exception { //打开模板ppt String mtemplateName = "E:/PIE/mtemplate/PIE" + dataList.size() + ".pptx"; String path ="E:/PIE/NewPPT/NewPIE" + dataList.size() + ".pptx"; XMLSlideShow pptx = new XMLSlideShow(new FileInputStream(mtemplateName)); pptx.setPageSize(new Dimension(960, 580)); for (int i = 0; i < dataList.size(); i++) { makePiePpt(pptx, i, dataList); } //保存文件 OutputStream out = new FileOutputStream(path); pptx.write(out); out.close(); System.out.println("导出成功"); } /** * @Description: * @Author: xsr * @date : 2018/7/27 5:41 */ public static void makePiePpt(XMLSlideShow pptx, Integer pieNum, List dataList) throws Exception { //获取第一个ppt页面 XSLFSlide slide = pptx.getSlides().get(0); //遍历第一页元素找到图表 XSLFChart chart; List poixmlDocumentParts = new ArrayList(); for (POIXMLDocumentPart part : slide.getRelations()) { if (part instanceof XSLFChart) { chart = (XSLFChart) part; poixmlDocumentParts.add(chart); } } chart = (XSLFChart) poixmlDocumentParts.get(pieNum); POIXMLDocumentPart xlsPart = chart.getRelations().get(0); //把图表绑定到Excel workbook XSSFWorkbook wb = new XSSFWorkbook(); XSSFSheet sheet = wb.createSheet(); CTChart ctChart = chart.getCTChart(); CTPlotArea plotArea = ctChart.getPlotArea(); CTPieChart pieChart = plotArea.getPieChartArray(0); // 获取图表的系列 CTPieSer ser = pieChart.getSerArray(0); XSSFRow row0 = sheet.createRow(0); // Series Text CTSerTx tx = ser.getTx(); tx.getStrRef().
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值