echarts- event - demo1.on ( 'event type', function (params) {}

 

ECharts support a conventional mouse event types, including 'the Click', 'the DblClick', 'mouseDown', 'mouseMove', 'mouseUp', 'mouseOver', 'mouseout', 'globalout', 'contextMenu' event. Here's look at a simple click open the sample histogram corresponding Baidu search page.
 
 <script src = "https://cdnjs.cloudflare.com/ajax/libs/echarts/4.2.1/echarts-en.common.js"> </ script> // introduced Online 
</ head> 
<body> 
< ID = div "the demo1" style = "width: 600px; height: 400px"> </ div> </ body> <Script type = "text / JavaScript"> // based ready dom, instance initialization echarts var the demo1 = echarts.init (document.getElementById ( 'the demo1' )); // the specified configurations and the data table var Option = { title: { text: 'ECharts start example' }, ToolTip: {}, Legend: { data:[ 'Sales' ] }, XAXIS: { Data: [ "Shirt", "sweater", "chiffon shirt", "pants", "shoes", "socks" ] }, YAXIS: {}, Series: [{ name: 'sales' , type: 'bar' , data: [ . 5, 20 is, 36, 10, 10, 20 is ] }] }; // use just specified configuration data items and display the chart. demo1.setOption (the Option);

// register the event demo1.on (
'the Click', }); // ECharts support a conventional type of mouse event, including 'the Click', 'DblClick', 'mouseDown', 'mouseMove', // 'mouseUp', 'mouseOver', 'mouseOut', 'globalout', 'contextMenu 'event. Here's look at a simple click open the sample histogram corresponding Baidu search page. </ script>

 

 

Guess you like

Origin www.cnblogs.com/IwishIcould/p/11465117.html