Skip to content

Commit 78879c5

Browse files
committed
Add gradient fill example. #4
1 parent 31754f4 commit 78879c5

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

examples/gradient_fill.py

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
from quickchart import QuickChart, QuickChartFunction
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+
"backgroundColor": QuickChartFunction("getGradientFillHelper('vertical', ['rgba(63, 100, 249, 0.2)', 'rgba(255, 255, 255, 0.2)'])"),
15+
}]
16+
}
17+
}
18+
19+
print(qc.get_url())

0 commit comments

Comments
 (0)