Highcharts:更改悬停排名图表上的颜色 [英] Highcharts: changing color on hover ranking chart
问题描述
现在我正在制作一个排名图表,因为我试图突出一个系列,所有其他的必须仍在图表上但变暗了.
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.
所以我试图在鼠标悬停时为变暗的系列改变颜色,这对我帮助很大Highcharts - 在 MouseOver 上更改系列颜色 但我不知道如何处理标记颜色,因为 mouseOver this.graph.attr('stroke', '#0000FF') 中的函数;
只改变线条颜色.在 highcharts 文档中寻找悬停"发现了这个
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'
}
}
}
我的问题是是否有办法在鼠标悬停功能中更改悬停系列的孔系列颜色,现在在这里工作 http://jsfiddle.net/diegomanule/UyF9u/
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/
提前致谢,
推荐答案
如果您不需要(在这种情况下您不必),您不应该直接操作 SVG.借用本文档 示例:
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'
});
}
},
更新小提琴 此处.
这篇关于Highcharts:更改悬停排名图表上的颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!