0

我正在覆盖工具提示以从纪元时间转换,因此我失去了我的系列的颜色上下文编码。它默认为黑色。默认情况下,高图表会在工具提示中添加带有系列名称的颜色上下文。

如何重新设置样式以使系列名称与系列线的颜色相同?

小提琴-> http://jsfiddle.net/EwpWh/3/

 tooltip: {
     enabled: true,
     formatter: function() {
               return Highcharts.dateFormat('%A, %b %e, %Y', this.x) + 
               '<br/>'+ this.series.name +': <b>' + Highcharts.numberFormat(this.point.y,0) + '</b>';
                 }
 },
4

1 回答 1

0

看起来以下将起作用:

  formatter: function() {
            return Highcharts.dateFormat('%A, %b %e, %Y', this.x) +
            '<br/><span style="color:' + this.series.color + ' ">'+ this.series.name +'</span>: <b>' + Highcharts.numberFormat(this.point.y,0) + '</b>';
              }

},

于 2013-08-07T06:57:50.107 回答