-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy path12_themes_gradient.php
More file actions
38 lines (33 loc) · 1.22 KB
/
Copy path12_themes_gradient.php
File metadata and controls
38 lines (33 loc) · 1.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<?php
/* Same data drawn three ways: light theme, dark theme, and a
* gradient-fill bar chart with a drop shadow on the bars, to show
* how the presentation knobs compose. Three charts on three files. */
require __DIR__ . '/_bootstrap.php';
$data = [['data' => [22, 35, 28, 41, 38, 47, 52]]];
$labels = ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'];
(new FastChart\BarChart(420, 260))
->setFontPath($font)
->setDpi($dpi)
->setTitle('Light theme')
->setSeries($data)
->setCategoryLabels($labels)
->setTheme(FastChart\Chart::THEME_LIGHT)
->renderToFile(__DIR__ . '/12a_theme_light.png');
(new FastChart\BarChart(420, 260))
->setFontPath($font)
->setDpi($dpi)
->setTitle('Dark theme')
->setSeries($data)
->setCategoryLabels($labels)
->setTheme(FastChart\Chart::THEME_DARK)
->renderToFile(__DIR__ . '/12b_theme_dark.png');
(new FastChart\BarChart(420, 260))
->setFontPath($font)
->setDpi($dpi)
->setTitle('Gradient + shadow')
->setSeries($data)
->setCategoryLabels($labels)
->setGradientFill(0x4F86C6, 0xE34A6F, FastChart\Chart::GRADIENT_VERTICAL)
->setDropShadow(3, 3, 0x000000)
->setShadowAlpha(80)
->renderToFile(__DIR__ . '/12c_gradient.png');