Hi I'm new to openpyxl and I'm reading the documentation. Here's the code that I write based on the docs.
from openpyxl import Workbook
from openpyxl.chart import (BarChart, Reference)
book = Workbook()
sheet = book.active
rows = (
('USA', 46),
('China', 38),
('UK', 29),
('Russia', 22),
('South Korea', 13),
('Germany', 11)
)
for row in rows:
sheet.append(row)
chart = BarChart()
data = Reference(sheet, min_row = 1, max_row=6, min_col=2, max_col=2)
cats = Reference(sheet, min_col=1, min_row=1, max_row=6)
chart.add_data(data)
chart.set_categories(cats)
sheet.add_chart(chart, 'A8')
book.save('chart.xlsx')
I ran the code then opened the file using LibreOffice the chart doesn't show axes. I have to manually 'Insert/Delete Axis' for them to show up. Is this due to the code or LibreOffice? Can anyone point me out?