Using Pandas and XlsxWriter to create Excel charts

An introduction to the creation of Excel files with charts using [Pandas](<http://pandas.pydata.org) and XlsxWriter.

    import pandas as pd

    ...

    writer = pd.ExcelWriter('farm_data.xlsx', engine='xlsxwriter')
    df.to_excel(writer, sheet_name='Sheet1')

    workbook = writer.book
    worksheet = writer.sheets['Sheet1']

    chart = workbook.add_chart({'type': 'column'})

    ...

Chart image

See the full document at ReadTheDocs.

GitHub

View Github