Highcharts:在悬停排名图表上更改颜色 [英] Highcharts: changing color on hover ranking chart

查看:1485
本文介绍了Highcharts:在悬停排名图表上更改颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

现在我正在排名图表上,因为我试图突出一个系列,所有其他必须仍然在图表上,但变暗。



我试图改变鼠标在灰色系列的颜色,这帮助了我很多 Highcharts - 在MouseOver上改变系列颜色但是我不知道如何处理标记颜色,因为mouseOver中的函数 this.graph.attr('stroke','#0000FF'); 只更改线条颜色。在highcharts中找到hover的文档找到此

 标记:{
fillColor:'#C0C0C0',
陈述:{
hover:{
fillColor:'#0000FF'
}
}
}
pre>

我的问题是如果有一种方法来改变鼠标悬停函数中悬浮系列的孔系列颜色,现在在这里工作 http://jsfiddle.net/diegomanule/UyF9u/



谢谢提前,

解决方案

如果你不需要直接操作SVG不得不)。借用此文档 exaple

 事件:{
mouseOver:function(){
this.update({
color:'#0000FF'
});
},
mouseOut:function(){
this.update({
color:'#C0C0C0'
});
}
},

更新小提琴此处


Right now I'm working on a ranking chart since I'm trying to highlight one serie, all others must be still on the chart but dimmed.

So I'm trying to change color on mouse over for the dimmed series, this helped me a lot Highcharts - change series color on MouseOver but I don't know how to handle the markers color because the function in mouseOver this.graph.attr('stroke', '#0000FF'); changes only the line color. Looking for "hover" in highcharts docs found this

    marker: {
        fillColor: '#C0C0C0',
        states: {
            hover: {
                fillColor: '#0000FF'
            }
        }
    }

My question is if there is a way to change the hole series color of the hovered series in the mouseover function, right now is working here http://jsfiddle.net/diegomanule/UyF9u/

Thanks in advance,

解决方案

You shouldn't directly manipulate the SVG if you don't have to (and in this case you don't have to). Borrowing from this documentation examaple:

   events: {
        mouseOver: function () {
            this.update({
                color: '#0000FF'
            });                
        },
        mouseOut: function () {
            this.update({
                color: '#C0C0C0'
            }); 
        }
    },

Updated fiddle here.

这篇关于Highcharts:在悬停排名图表上更改颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆