Python third-party library OPENPYXL (3)

Source: Internet
Author: User

Python third-party library OPENPYXL (3)Area Map

An area chart is similar to a line chart, where the area below the drawing line is populated and different variants can be obtained by setting the grouping to "standard", "stacked", or "percentstacked". Standard "is the default.

Area Map

 fromOpenpyxlImportWorkbook fromOpenpyxl.chartImport(AreaChart, Reference, Series,) WB=Workbook () WS=wb.activerows= [    [' Number','Batch 1','Batch 2'],    [2, 40, 30],    [3, 40, 25],    [4, 50, 30],    [5, 30, 10],    [6, 25, 5],    [7, 50, 10],] forRowinchrows:ws.append (ROW) chart=AreaChart () chart.title="Area Chart"Chart.style= 13Chart.x_axis.title='Test'Chart.y_axis.title='Percentage'Cats= Reference (WS, Min_col=1, Min_row=1, max_row=7) Data= Reference (WS, min_col=2, Min_row=1, max_col=3, max_row=7) chart.add_data (data, Titles_from_data=True) Chart.set_categories (cats) Ws.add_chart (chart,"A10") Wb.save ("area.xlsx")
Operation Result:

3D Area Map
 fromOpenpyxlImportWorkbook fromOpenpyxl.chartImport(Areachart3d, Reference, Series,) WB=Workbook () WS=wb.activerows= [    [' Number','Batch 1','Batch 2'],    [2, 30, 40],    [3, 25, 40],    [4, 30, 50],    [5, 10, 30],    [6, 5, 25],    [7, 10, 50],] forRowinchrows:ws.append (ROW) chart=Areachart3d () chart.title="Area Chart"Chart.style= 13Chart.x_axis.title='Test'Chart.y_axis.title='Percentage'Chart.legend=Nonecats= Reference (WS, Min_col=1, Min_row=1, max_row=7) Data= Reference (WS, min_col=2, Min_row=1, max_col=3, max_row=7) chart.add_data (data, Titles_from_data=True) Chart.set_categories (cats) Ws.add_chart (chart,"A10") Wb.save ("area3d.xlsx")
Run Results

Python third-party library OPENPYXL (3)

Related Article

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.