highcharts pass multiple values to tooltip

后端 未结 5 1825
清歌不尽
清歌不尽 2020-12-08 20:58

I need to display 3 values on the tooltip: the time, the value and another value(change).

I saw this example (but the jsdfiddle is not working).

I tried thi

5条回答
  •  粉色の甜心
    2020-12-08 21:47

    two ways.

    1

    series: [
              { ...
                tooltip:
                  {pointFormat: "{series.name}: {point.y} {y2}
    "} }, ... ] o = Highcharts.Point.prototype.tooltipFormatter Highcharts.Point.prototype.tooltipFormatter=function(format){return o.call(this, format).replace("{y2}", this.config[2]);}

    2

     a = new Highcharts.StockChart(options); 
     a.series[0].tooltipFormatter = function(item) { return "" +item.series.name+": "+item.y+item.point.config[2]+"
    "; }

提交回复
热议问题