highcharts pass multiple values to tooltip

后端 未结 5 1837
清歌不尽
清歌不尽 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 22:00

    If you want to pass additional data for a point other than the x and y values, then you have to name that value. In the following example I add the following three additional values to each data point:

    {
      y: 3,
      locked: 1,
      unlocked: 1,
      potential: 1,
    }
    

    Then to access and display those values in the tooltip I use the following:

    tooltip: 
    {
         formatter: function() { return ' ' +
            'Locked: ' + this.point.locked + '
    ' + 'Unlocked: ' + this.point.unlocked + '
    ' + 'Potential: ' + this.point.potential; } }

提交回复
热议问题