You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by GitBox <gi...@apache.org> on 2020/06/19 08:13:27 UTC

[GitHub] [incubator-echarts] Ropynn opened a new issue #12831: echartsInstance. on事件中的参数query不生效

Ropynn opened a new issue #12831:
URL: https://github.com/apache/incubator-echarts/issues/12831


   ### Version
   4.8.0
   
   ### Steps to reproduce
   <!doctype html>
   <html lang="en">
   <head>
       <meta charset="UTF-8">
       <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
       <meta http-equiv="X-UA-Compatible" content="ie=edge">
       <title>Document</title>
       <script src="https://cdn.bootcdn.net/ajax/libs/echarts/4.8.0/echarts-en.common.js"></script>
   </head>
   <body>
   <div id="main" style="width: 600px;height:400px;"></div>
   </body>
   </html>
   <script type="text/javascript">
   	var myChart = echarts.init(document.getElementById('main'));
   	var option = {
   		title: {
   			text: 'ECharts 入门示例'
   		},
   		tooltip: {},
   		legend: {
   			data: ['销量']
   		},
   		xAxis: {
   			data: ["衬衫", "羊毛衫", "雪纺衫", "裤子", "高跟鞋", "袜子"]
   		},
   		yAxis: {},
   		series: [{
   			name: '销量',
   			type: 'bar',
   			data: [5, 20, 36, 10, 10, 20]
   		}],
   	};
   
   	myChart.setOption(option);
   	myChart.on('click', 'legend', function (params) {
   		console.log(123);
   		console.log(params);
   	});
   </script>
   
   ### What is expected?
   打印 123 和 params
   
   ### What is actually happening?
   无任何反应
   
   <!-- This issue is generated by echarts-issue-helper. DO NOT REMOVE -->
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org


[GitHub] [incubator-echarts] Ropynn closed issue #12831: echartsInstance. on事件中的参数query不生效

Posted by GitBox <gi...@apache.org>.
Ropynn closed issue #12831:
URL: https://github.com/apache/incubator-echarts/issues/12831


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org


[GitHub] [incubator-echarts] zhouxin860114 commented on issue #12831: echartsInstance. on事件中的参数query不生效

Posted by GitBox <gi...@apache.org>.
zhouxin860114 commented on issue #12831:
URL: https://github.com/apache/incubator-echarts/issues/12831#issuecomment-648020816


   > > if you want watch the `legend` click event may be use [legendselectchanged](https://echarts.apache.org/zh/tutorial.html#ECharts%20%E4%B8%AD%E7%9A%84%E4%BA%8B%E4%BB%B6%E5%92%8C%E8%A1%8C%E4%B8%BA)?
   > > ![image](https://user-images.githubusercontent.com/5130528/85241938-1501d580-b470-11ea-868b-f3e6fbda2f5c.png)
   > 
   > 谢谢你的回答,但是我想要的是其他的鼠标事件,不一定只是点击事件.
   
   拿柱图自己做一个图例是不是可以?做了个简易的示例:
   [](https://gallery.echartsjs.com/editor.html?c=xeyxqD5RPy&v=1)
   ![image](https://user-images.githubusercontent.com/8022228/85386144-ce969e80-b575-11ea-97f3-2b4cb0979e18.png)
   ![image](https://user-images.githubusercontent.com/8022228/85386181-d9513380-b575-11ea-9f25-c6ebab50962f.png)
   ```myChart.on('click', {
       seriesName: 'myLegend'
   }, function(params) {
       console.log(123);
       console.log(params);
   
       if (params.color === '#CCC') {
           myChart.dispatchAction({
               type: 'legendSelect',
               // 图例名称
               name: params.name
           });
           option.series[params.seriesIndex].data[params.dataIndex].itemStyle.color = colorList[params.dataIndex];
           myChart.setOption(option);
   
       } else {
           myChart.dispatchAction({
               type: 'legendUnSelect',
               // 图例名称
               name: params.name
           });
           option.series[params.seriesIndex].data[params.dataIndex].itemStyle.color = '#CCC';
           myChart.setOption(option);
   
       }
   });```
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org


[GitHub] [incubator-echarts] Ropynn commented on issue #12831: echartsInstance. on事件中的参数query不生效

Posted by GitBox <gi...@apache.org>.
Ropynn commented on issue #12831:
URL: https://github.com/apache/incubator-echarts/issues/12831#issuecomment-647228786


   > if you want watch the `legend` click event may be use [legendselectchanged](https://echarts.apache.org/zh/tutorial.html#ECharts%20%E4%B8%AD%E7%9A%84%E4%BA%8B%E4%BB%B6%E5%92%8C%E8%A1%8C%E4%B8%BA)?
   > ![image](https://user-images.githubusercontent.com/5130528/85241938-1501d580-b470-11ea-868b-f3e6fbda2f5c.png)
   
   谢谢你的回答,但是我想要的是其他的鼠标事件,不一定只是点击事件.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org


[GitHub] [incubator-echarts] Ropynn commented on issue #12831: echartsInstance. on事件中的参数query不生效

Posted by GitBox <gi...@apache.org>.
Ropynn commented on issue #12831:
URL: https://github.com/apache/incubator-echarts/issues/12831#issuecomment-648056340


   > > > if you want watch the `legend` click event may be use [legendselectchanged](https://echarts.apache.org/zh/tutorial.html#ECharts%20%E4%B8%AD%E7%9A%84%E4%BA%8B%E4%BB%B6%E5%92%8C%E8%A1%8C%E4%B8%BA)?
   > > > ![image](https://user-images.githubusercontent.com/5130528/85241938-1501d580-b470-11ea-868b-f3e6fbda2f5c.png)
   > > 
   > > 
   > > 谢谢你的回答,但是我想要的是其他的鼠标事件,不一定只是点击事件.
   > 
   > 拿柱图自己做一个图例是不是可以?做了个简易的示例:
   > https://gallery.echartsjs.com/editor.html?c=xeyxqD5RPy&v=1
   > 
   > ![image](https://user-images.githubusercontent.com/8022228/85386467-39e07080-b576-11ea-996f-0c494e43fa3d.png)
   > 
   > ![image](https://user-images.githubusercontent.com/8022228/85386440-3220cc00-b576-11ea-8ab2-75192ae64bb5.png)
   
   可以的,谢谢


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org


[GitHub] [incubator-echarts] wf123537200 commented on issue #12831: echartsInstance. on事件中的参数query不生效

Posted by GitBox <gi...@apache.org>.
wf123537200 commented on issue #12831:
URL: https://github.com/apache/incubator-echarts/issues/12831#issuecomment-647226202


   if you want watch the ```legend``` click event may be use [legendselectchanged](https://echarts.apache.org/zh/tutorial.html#ECharts%20%E4%B8%AD%E7%9A%84%E4%BA%8B%E4%BB%B6%E5%92%8C%E8%A1%8C%E4%B8%BA)?
   ![image](https://user-images.githubusercontent.com/5130528/85241938-1501d580-b470-11ea-868b-f3e6fbda2f5c.png)
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org


[GitHub] [incubator-echarts] zhouxin860114 edited a comment on issue #12831: echartsInstance. on事件中的参数query不生效

Posted by GitBox <gi...@apache.org>.
zhouxin860114 edited a comment on issue #12831:
URL: https://github.com/apache/incubator-echarts/issues/12831#issuecomment-648020816


   > > if you want watch the `legend` click event may be use [legendselectchanged](https://echarts.apache.org/zh/tutorial.html#ECharts%20%E4%B8%AD%E7%9A%84%E4%BA%8B%E4%BB%B6%E5%92%8C%E8%A1%8C%E4%B8%BA)?
   > > ![image](https://user-images.githubusercontent.com/5130528/85241938-1501d580-b470-11ea-868b-f3e6fbda2f5c.png)
   > 
   > 谢谢你的回答,但是我想要的是其他的鼠标事件,不一定只是点击事件.
   
   拿柱图自己做一个图例是不是可以?做了个简易的示例:
   [](https://gallery.echartsjs.com/editor.html?c=xeyxqD5RPy&v=1)
   
   ![image](https://user-images.githubusercontent.com/8022228/85386467-39e07080-b576-11ea-996f-0c494e43fa3d.png)
   
   ![image](https://user-images.githubusercontent.com/8022228/85386440-3220cc00-b576-11ea-8ab2-75192ae64bb5.png)
   
   
   ```myChart.on('click', {
       seriesName: 'myLegend'
   }, function(params) {
       console.log(123);
       console.log(params);
   
       if (params.color === '#CCC') {
           myChart.dispatchAction({
               type: 'legendSelect',
               // 图例名称
               name: params.name
           });
           option.series[params.seriesIndex].data[params.dataIndex].itemStyle.color = colorList[params.dataIndex];
           myChart.setOption(option);
   
       } else {
           myChart.dispatchAction({
               type: 'legendUnSelect',
               // 图例名称
               name: params.name
           });
           option.series[params.seriesIndex].data[params.dataIndex].itemStyle.color = '#CCC';
           myChart.setOption(option);
   
       }
   });```
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org


[GitHub] [incubator-echarts] echarts-bot[bot] commented on issue #12831: echartsInstance. on事件中的参数query不生效

Posted by GitBox <gi...@apache.org>.
echarts-bot[bot] commented on issue #12831:
URL: https://github.com/apache/incubator-echarts/issues/12831#issuecomment-646504739


   Hi! We've received your issue and please be patient to get responded. 🎉
   The average response time is expected to be within one day for weekdays.
   
   In the meanwhile, please make sure that **you have posted enough image to demo your request**. You may also check out the [API](http://echarts.apache.org/api.html) and [chart option](http://echarts.apache.org/option.html) to get the answer.
   
   If you don't get helped for a long time (over a week) or have an urgent question to ask, you may also send an email to dev@echarts.apache.org. Please attach the issue link if it's a technical questions.
   
   If you are interested in the project, you may also subscribe our [mail list](https://echarts.apache.org/en/maillist.html).
   
   Have a nice day! 🍵


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org


[GitHub] [incubator-echarts] zhouxin860114 edited a comment on issue #12831: echartsInstance. on事件中的参数query不生效

Posted by GitBox <gi...@apache.org>.
zhouxin860114 edited a comment on issue #12831:
URL: https://github.com/apache/incubator-echarts/issues/12831#issuecomment-648020816






----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org