Harmonise chart reference and sheet coordinates.
Created originally on Bitbucket by Daniele S.
I use this code to create a chart ( I tried with LineChart and BarChart with similar results ).
#!python
# LINE GRAPH
if ws_chart:
ws_chart.title = "Crashes per day Graph"
values = Reference(ws, (0, 1), (i, 1), 'n', NumberFormat.FORMAT_NUMBER)
labels = Reference(ws, (0, 0), (i, 0), 's')
series = Series(values, labels=labels, title="Crashes per Day Trend")
chart = BarChart()
chart.append(series)
ws_chart.add_chart(chart)
Excel screenshot. http://i.imgur.com/L45PP3O.png
After repairing the file works ok but I cannot ship a report like that.
OS. Windows 7 64bit EXCEL: 2007 Python: 2.7.6 OpenPyXl: 1.8.3
Attachments: unreadable_data.py