Skip to content

Commit 16f6246

Browse files
committed
Add simple example with function
1 parent 0b98b66 commit 16f6246

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
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: ['Q1', 'Q2', 'Q3', 'Q4'],
11+
datasets: [{
12+
label: 'Users',
13+
data: [50, 60, 70, 180]
14+
}, {
15+
label: 'Revenue',
16+
data: [100, 200, 300, 400]
17+
}]
18+
},
19+
options: {
20+
scales: {
21+
yAxes: [{
22+
ticks: {
23+
callback: (val) => {
24+
return val + 'k';
25+
}
26+
}
27+
}]
28+
}
29+
}
30+
}'''
31+
32+
print(qc.get_url())

0 commit comments

Comments
 (0)