2015-05-28 62 views
1

如何更改区域图中MouseOver事件上的所有区域的颜色除外?Highcharts:如何更改区域绘图中的MouseOver事件上的所有区域的颜色

这是行不通

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 
    }); 
} 

我怎样才能装进标记dataLabels?

http://jsfiddle.net/cms5Lrdv/12/(图像就应该是这样 - 内)提前

回答

2

由于使用this.areathis.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", 
          }); 
         } 
        }); 

       }, 
+0

非常感谢您! – Nadia

相关问题