Search code examples
tooltiphighcharts

highstock. Can I add one line of tooltip when the point is in the area of plotbands?


I have a line and several plotbands in a stockchart.

First I wanna show the plotband's name as it's label, but when the timerange is "all", then the plotband's width is so short, and the label overlap on each other.

So I wannt show the plotband's name in the point's tooltip, such as:

Tooltip's head
* plotband's name
* lineName: xxx

When the point is not in a plotbands, then the "plotband's name " shouldn't be shown.

Can I? or is there any other method to show the plotband's name properly, without overlap?


Solution

  • Solved by myself,“formatter” can be used,and we can get the plotbands info by this.series.options.xAxis[0].plotBands, then we can judge whether the point is in current bands.