Highcharts:如何改变所有区域的颜色,除了鼠标悬停事件中的一个区域



如何在区域图中更改除鼠标悬停事件外的所有区域的颜色?

This is not work

var colors_grey = ["#eeeeee", "#e3e3e3","#e5e5e5", "#e6e6e6","#ededed", "#ececec"];
...
mouseOver: function () {
   var serie = this.chart.series;
   $.each(serie, function (i, e) {
        this.graph.attr({
            fill:  colors_grey[i],
            fillColor: colors_grey[i],
            stroke:  colors_grey[i]
        });
    });
    this.graph.attr({
        fillColor:  this.color
    });
}

和我怎么能适合数据标签内标记?

http://jsfiddle.net/cms5Lrdv/12/(图片应该是什么样子- inside)

Thanks in advance

使用this.area而不是this.graph,参见:http://jsfiddle.net/cms5Lrdv/23/

                mouseOver: function () {
                   var self = this,
                       serie = this.chart.series;
                   $.each(serie, function (i, e) {
                       if(this != self) {
                           this.area.attr({
                               fill:  colors_grey[i],
                               fillColor: "#ff0000",
                               stroke:  "#ff0000",
                           });
                       } else {
                           this.area.attr({
                               fill:  "orange",
                               fillColor: "#ff0000",
                               stroke:  "#ff0000",
                           });   
                       }
                    });
                },

相关内容

  • 没有找到相关文章

最新更新