| 1 | import csv |
| 2 | |
| 3 | import leather |
| 4 | |
| 5 | with open('examples/realdata/gii.csv') as f: |
| 6 | reader = csv.reader(f) |
| 7 | next(reader) |
| 8 | data = list(reader)[:10] |
| 9 | |
| 10 | for row in data: |
| 11 | row[1] = float(row[1]) if row[1] is not None else None |
| 12 | |
| 13 | chart = leather.Chart('Data from CSV reader') |
| 14 | chart.add_bars(data, x=1, y=0) |
| 15 | chart.to_svg('examples/charts/csv_reader.svg') |