Python--pptx--The same sequence of multiple data

Source: Internet
Author: User

From pptx import Presentation
From Pptx.util import Inches
From Pptx.enum.text import mso_auto_size
From Pptx.enum.chart import Xl_tick_mark
From Pptx.util import Pt
From Pptx.chart.data import ChartData
From pptx.enum.shapes import Mso_auto_shape_type,mso_connector_type
From Pptx.dml.color import RGBColor
From Pptx.enum.chart import xl_data_label_position
From Pptx.enum.chart import xl_legend_position
From Pptx.enum.chart import Xl_chart_type
From Pptx.enum.chart import Xl_marker_style
From Pptx.enum.chart import xl_tick_label_position

PRS = Presentation (' 2017 North section of the first stage of satisfaction survey report v.7.0 reporting. pptx ')
SLIDE=PRS.SLIDES[10]
For shape in Slide.shapes:
If not shape.has_chart:
Continue
Else

Chart = Shape.chart
Chart_data = ChartData ()

chart_data.categories = [' Group 1 ', ' ', ' Group 2 ', ' Group 3 ', ' Group 4 ', ' Group 5 ',]
Chart_data.add_series (' Industry comparison ', (19, ', 20,22,25,30))
Chart_data.add_series (' Industry comparison ', (29, ', 35,26,37,20))
Chart_data.add_series (' Industry comparison ', (30, ', 18,40,15,41))


Chart.replace_data (Chart_data)
Prs.save (' test.pptx ')

Python--pptx--The same sequence of multiple data

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.