我在向使用 highcharts 库创建的图表中的标题添加自定义工具提示时遇到问题。当我尝试使用 jquery 选择标题 dom 并将工具提示内容附加到标题时,highcharts 没有呈现我要添加的 html 内容。有人可以帮助添加工具提示吗?
我试过下面的方法,它没有用。
title: {
text: 'Plan Duration',
tooltip: {
formatter: function () {
return 'Testing';
}
},
},
类似地,我尝试访问 DOM 元素并附加工具提示内容
($('.highcharts-title')[1]).tooltip({
content: 'TOOLTIP CONTENT'
});
两种技术都失败了
最佳答案
Tootips 应该在 series
中定义。
series: [{
tooltip: {
pointFormat: '<span>Custom text including HTML tags... Whatever.</span>'
},
// Other properties...
关于javascript - 无法为 highcharts 中的标题添加工具提示,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46085040/