Skip to content

Instantly share code, notes, and snippets.

@t2y
Created February 9, 2021 00:35
Show Gist options
  • Save t2y/168d7cfbb2d1c274199b706bcf1b1887 to your computer and use it in GitHub Desktop.
Save t2y/168d7cfbb2d1c274199b706bcf1b1887 to your computer and use it in GitHub Desktop.
chart のデータラベルの表示
import sys
from openpyxl import load_workbook
from pprint import pprint
if len(sys.argv) < 2:
print(f'{__file__}の後にExcelファイルを指定してください')
sys.exit(0)
filename = sys.argv[1]
wb = load_workbook(filename)
ws = wb.active
for chart in ws._charts:
pprint(chart.dataLabels)
@t2y
Copy link
Author

t2y commented Feb 9, 2021

なにかヒントになる内容が出力されるかも?

$ python dump_chart_dataLabels.py store_sales_vertical_percent_stacked2.xlsx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment