There are currently four type of data layouts for rendering charts.
Series names are placed in the first row. The rest of the rows are data sets.
pie.csv
Here is the source code using pyexcel
title = 'Browser usage in February 2012 (in %)' sheet = pyexcel.get_sheet(file_name='pie.csv') svg = sheet.plot(chart_type='pie', title=title)
box.csv
Here is the source code using pyexcel:
title = 'V8 benchmark results' sheet = pyexcel.get_sheet(file_name='box.csv') svg = sheet.plot(chart_type='box', title=title, width=600, height=400, explicit_size=True)
On top of previous layout, x labels were inserted as the first column. In other words, each column represents series data and the first column contains x labels. y labels locate in the first row
line.csv
Here is the source code using pyexcel:
title = 'Browser usage evolution (in %)' sheet = pyexcel.get_sheet(file_name='line.csv') svg = sheet.plot(chart_type='line', title=title, width=600, height=400, explicit_size=True)
radar.csv
Here is the source code using pyexcel:
title = 'V8 benchmark results' sheet = pyexcel.get_sheet(file_name='radar.csv') svg = sheet.plot(chart_type='dot', title=title, width=600, height=400, explicit_size=True)
funnel.csv
Here is the source code using pyexcel:
title = 'V8 benchmark results' sheet = pyexcel.get_sheet(file_name='funnel.csv') svg = sheet.plot(chart_type='funnel', title=title, width=600, height=400, explicit_size=True)
radar.csv
Here is the source code using pyexcel:
title = 'V8 benchmark results' sheet = pyexcel.get_sheet(file_name='radar.csv') svg = sheet.plot(chart_type='radar', title=title, width=600, height=400, explicit_size=True)
To draw a histogram, heights, starts and stops should be placed sequentially in first, second and third columns.
histogram_single.csv
Here is the source code using pyexcel:
sheet = pyexcel.get_sheet(file_name='histogram_single.csv') svg = sheet.plot(chart_type='histogram')
In order to draw multiple histogram on the same chart, you will need to use a Book, each sheet of which become a histogram. Here is how you can draw multiple histogram.
Here is the source code using pyexcel
histogram.csv
sheet = pyexcel.get_sheet(file_name='histogram.csv') svg = sheet.plot(chart_type='histogram', alpha=0.5)
In order to draw XY graph, x, y data should be placed vertically at first and second column. In order to draw multiple lines, their data should be placed in individual sheets.
xy.xlsx
Here is the source code using pyexcel
book = pyexcel.get_book(file_name='xy.xlsx') svg = book.plot(chart_type='xy', width=600, height=400, explicit_size=True)