在标记点上自定义Highcharts工具提示并在其他点上显示默认工具提示

问题描述:

我有一张Highcharts折线图并且启用了工具提示。 我如何定制只有标记点的工具提示,并让所有其他点显示默认工具提示。我需要在包含标记点的工具提示中添加额外的文本。在标记点上自定义Highcharts工具提示并在其他点上显示默认工具提示

我已经找到了如何做到这一点:

tooltip :{ 
    formatter: function(a) { 
     if(condition) 
      return "custom tooltip for the marker point"; 

     //otherwise call the defaultFormatter function this way 
     return a.defaultFormatter.call(this, a); 
    } 
}