{"action":"opened","issue":{"url":"https://api.github.com/repos/antvis/f2/issues/362","repository_url":"https://api.github.com/repos/antvis/f2","labels_url":"https://api.github.com/repos/antvis/f2/issues/362/labels{/name}","comments_url":"https://api.github.com/repos/antvis/f2/issues/362/comments","events_url":"https://api.github.com/repos/antvis/f2/issues/362/events","html_url":"https://github.com/antvis/f2/issues/362","id":365769707,"node_id":"MDU6SXNzdWUzNjU3Njk3MDc=","number":362,"title":"[Legend] onClick event prevents chart repaint","user":{"login":"disoul","id":8756894,"node_id":"MDQ6VXNlcjg3NTY4OTQ=","avatar_url":"https://avatars0.githubusercontent.com/u/8756894?v=4","gravatar_id":"","url":"https://api.github.com/users/disoul","html_url":"https://github.com/disoul","followers_url":"https://api.github.com/users/disoul/followers","following_url":"https://api.github.com/users/disoul/following{/other_user}","gists_url":"https://api.github.com/users/disoul/gists{/gist_id}","starred_url":"https://api.github.com/users/disoul/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/disoul/subscriptions","organizations_url":"https://api.github.com/users/disoul/orgs","repos_url":"https://api.github.com/users/disoul/repos","events_url":"https://api.github.com/users/disoul/events{/privacy}","received_events_url":"https://api.github.com/users/disoul/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-10-02T07:18:50Z","updated_at":"2018-10-02T07:18:50Z","closed_at":null,"author_association":"NONE","body":"<!--\r\nThank you for reporting an issue.\r\n\r\n1. It's RECOMMENDED to submit PR for typo or tiny bug fix.\r\n2. If this's a FEATURE request, please provide: details, pseudo codes if necessary.\r\n3. If this's a BUG, please provide: course repetition, error log and configuration. Fill in as much of the template below as you're able.\r\n4. It will be nice to use to provide a CodePen Link which can reproduce the issue, we provide a CodePen template [f2-github-issue](https://codepen.io/Sima/pen/qVgdex).\r\n\r\n感谢您向我们反馈问题。\r\n\r\n1. 提交问题前，请先阅读 https://antv.alipay.com/zh-cn/f2/3.x/index.html 上的文档。\r\n2. 我们推荐如果是小问题（错别字修改，小的 bug fix）直接提交 PR。\r\n3. 如果是一个新需求，请提供：详细需求描述，最好是有伪代码实现。\r\n4. 如果是一个 BUG，请提供：复现步骤，错误日志以及相关配置，并尽量填写下面的模板中的条目。\r\n5. 如果可以，请提供尽可能精简的 CodePen 链接，可使用 CodePen 模板 https://codepen.io/Sima/pen/qVgdex，方便我们排查问题。\r\n6. 扩展阅读：[如何向开源项目提交无法解答的问题](https://zhuanlan.zhihu.com/p/25795393)\r\n-->\r\n\r\n* **F2 Version**: 3.2.3\r\n* **Platform**: Chrome\r\n* **Mini Showcase(like screenshots)**:\r\n* **CodePen Link**:\r\n\r\n<!-- Enter your issue details below this comment. -->\r\nI added label and legend to my pie chart based on this [document](https://antv.alipay.com/zh-cn/f2/3.x/demo/pie/labelline-pie.html)\r\n![image](https://user-images.githubusercontent.com/8756894/46334014-1adcd500-c655-11e8-8123-bef5d60ea087.png)\r\nNow i want to handle legend click event to update label position, so i used `onClick` event in my legend options.But once I set this option, the chart will not be repainted.    \r\nI think the problem code is [here](https://github.com/antvis/f2/blob/master/src/plugin/legend.js#L328). I can't understand why F2 uses conditional statements here. So if i just want to listen to click events, what should I do?"}}
{"actor":{"display_login":"disoul"}}