为什么要在高图的传说中出现鼠标悬停事件?(why to get mouse out event in legend in highchart?)

编程入门 行业动态 更新时间:2024-10-24 04:50:16
为什么要在高图的传说中出现鼠标悬停事件?(why to get mouse out event in legend in highchart?)

https://plnkr.co/edit/JCOQa1vdqU9KBusqlOlL?p=preview嗨我做了一个简单的演示甜甜圈图表。我想在传说中获得mouseover事件和mouseout事件。我能够在甜甜圈切片上获得mouseover事件。它是工作得很好。我想在传说中使用相同的功能。我在传说中获得了mouseover事件,但是我的mouseout事件没有解除为什么?

$(chart.series[1].data).each(function(i, point) { $(point.legendItem.element).hover(function () { // on over for (var i = 0; i < chart.series[1].data.length; i++) { chart.series[1].data[i].update({ color: i === point.index ? point.options.origColor:'grey' }, false, false); } chart.series[1].chart.redraw(); }, function () { // on mouseout alert('--') }); });

在鼠标移出时,我想将其移动到原始/相同的状态

https://plnkr.co/edit/JCOQa1vdqU9KBusqlOlL?p=preview Hi I make a simple demo of donut chart .I want to get mouseover event and mouseout event on legends.I am able to get mouseover event on donut slices.It is working fine.I want same functionality on legends.I get mouseover event on legend but my mouseout event not fired why ?

$(chart.series[1].data).each(function(i, point) { $(point.legendItem.element).hover(function () { // on over for (var i = 0; i < chart.series[1].data.length; i++) { chart.series[1].data[i].update({ color: i === point.index ? point.options.origColor:'grey' }, false, false); } chart.series[1].chart.redraw(); }, function () { // on mouseout alert('--') }); });

on mouse out I want to move it on original/same state

更多推荐

本文发布于:2023-07-24 10:54:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1245013.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:鼠标   要在   传说中   事件   legend

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!