MCPcopy
hub / github.com/apache/echarts / init

Function init

test/types/cjs/main.ts:22–59  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

20import echarts = require('echarts');
21
22function init() {
23 var myChart = echarts.init(document.getElementById('chart0'));
24
25 const option: echarts.EChartsOption = {
26 title: {
27 text: 'ECharts Getting Started Example'
28 },
29 tooltip: {},
30 xAxis: {
31 data: ['a', 'b', 'c', 'd', 'e', 'f']
32 },
33 yAxis: {},
34 series: [
35 {
36 name: 'sales',
37 type: 'bar',
38 data: [5, 20, 36, 10, 10, 20]
39 }
40 ]
41 };
42
43 myChart.on('click', function (params) {
44 console.log(params.name);
45 this.off('click');
46 });
47
48 myChart.on('rendered', function (params) {
49 console.log(params.elapsedTime);
50 this.off('rendered');
51 });
52
53 myChart.getZr().on('click', function (params) {
54 console.log(params.offsetX);
55 this.off('click');
56 });
57
58 myChart.setOption(option);
59}
60
61export function start() {
62 init();

Callers 2

startFunction · 0.70
createChartFunction · 0.50

Calls 3

getZrMethod · 0.65
initMethod · 0.45
setOptionMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…