问题描述
我试图找到最简单的方法,当您将鼠标悬停在情节带上时,会显示一个工具提示。事件部分没有问题,我可以访问鼠标悬停,但我需要找到一种方式来显示与Highcharts的默认外观相同样式的工具提示。
I'm trying to find the easiest way to have a tooltip show up when you hover over a plotband. The events part is fine, I can access mouseover and out but I need to find a way to display a tooltip in the same style as the default look and feel for Highcharts.
这是。我需要文本显示在悬停在工具提示显示为一个工具提示样式相同作为基于鼠标坐标的某处的Highcharts默认?
Here's a quick example. I need the text "Show me on hover in a tooltip" to display as a tooltip styled the same as Highcharts default somewhere based on the mouse coordinates?
我已经有查看并找不到任何帮助。
I've had a look at the docs and couldn't find any help.
任何想法?
预先感谢。
推荐答案
下面是我在中放置的一个解决方案,虽然这有点破解。
Here's one solution I've put together in JSFiddle, although it's a bit of a hack.
将以下行添加到mouseover事件中:
Add the following line to the mouseover event:
chart.tooltip.refresh(chart.series[1].points[2]);
这将显示隐藏系列中适当放置点的工具提示。
This displays the tooltip for an appropriately placed point in a hidden series.
自定义工具提示格式化程序然后返回所需的文本。
A custom tooltip formatter then returns the required text.
这篇关于Highcharts + Plotband工具提示悬停+默认样式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!