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
39
40
41
42
43
44
45
| import {init, use, ComposeOption} from '../../core';
| import {
| BarChart,
| BarSeriesOption,
| LineChart,
| LineSeriesOption
| } from '../../charts';
| import {
| GridComponent,
| GridComponentOption,
|
| DataZoomComponent,
| DataZoomComponentOption,
| } from '../../components';
| import {
| CanvasRenderer
| } from '../../renderers';
|
| use([BarChart, LineChart, GridComponent, DataZoomComponent, CanvasRenderer]);
|
| type Option = ComposeOption<
| GridComponentOption | DataZoomComponentOption
| | BarSeriesOption | LineSeriesOption
| >;
|
| const option: Option= {
| // xAxis and yAxis should been add as dependencies
| xAxis: {
| min: 0,
| max: 10
| },
| yAxis: {
| min: 0,
| max: 10
| },
| series: [{
| type: 'bar'
| }]
| }
|
| const dom = document.createElement('div');
| dom.className = 'chart';
|
| const chart = init(dom);
| chart.setOption(option);
|
|