Skip to content

Commit ae2b10d

Browse files
committed
add write file example
1 parent 23cea9d commit ae2b10d

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

examples/write_file.py

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
from quickchart import QuickChart
2+
3+
qc = QuickChart()
4+
qc.width = 600
5+
qc.height = 300
6+
qc.device_pixel_ratio = 2.0
7+
qc.config = {
8+
"type": "bar",
9+
"data": {
10+
"labels": ["Hello world", "Test"],
11+
"datasets": [{
12+
"label": "Foo",
13+
"data": [1, 2]
14+
}]
15+
}
16+
}
17+
18+
qc.to_file('/tmp/mychart.png')
19+
20+
print('Done.')

0 commit comments

Comments
 (0)