()
| 20 | import echarts = require('echarts'); |
| 21 | |
| 22 | function 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 | |
| 61 | export function start() { |
| 62 | init(); |
no test coverage detected
searching dependent graphs…