- Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathsimple_example.py
More file actions
Latest commit
16 lines (14 loc) · 568 Bytes
/
Copy pathsimple_example.py
File metadata and controls
16 lines (14 loc) · 568 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
fromquickchartimportQuickChart
qc=QuickChart()
qc.width=600
qc.height=300
qc.device_pixel_ratio=2.0
qc.config= {
"type": "bar",
"data": {
"labels": ["Hello world", "Test"],
"datasets": [{"label": "Foo", "data": [1, 2]}],
},
}
print(qc.get_url())
# https://quickchart.io/chart?c=%7B%22type%22%3A+%22bar%22%2C+%22data%22%3A+%7B%22labels%22%3A+%5B%22Hello+world%22%2C+%22Test%22%5D%2C+%22datasets%22%3A+%5B%7B%22label%22%3A+%22Foo%22%2C+%22data%22%3A+%5B1%2C+2%5D%7D%5D%7D%7D&w=600&h=300&bkg=%23ffffff&devicePixelRatio=2.0&f=png