Highcharts-更新系列会导致与工具提示相关的错误(mouseOver)
Highcharts - updating series leads to tooltip-related error (mouseOver)
从这个简单的fiddle中可以看出,在数据点上触发mouseOver事件并通过series.update()
更新系列的属性会导致js错误:
Uncaught TypeError: Cannot read property 'tooltipOptions' of null
代码:
plotOptions: {
series: {
cursor: 'pointer',
point: {
events: {
mouseOver: function () {
console.log('why does an error appear?');
this.series.update({
lineWidth: 10
});
},
mouseOut: function () {
console.log('bla');
}
}
}
}
},
我做错了什么?谢谢提供信息。
将工具提示设置为enabled: false
时,错误消息为:
Uncaught TypeError: object is not a function highcharts.js:300
r.onMouseOver highcharts.js:300
Wa.runPointActions highcharts.js:158
Wa.onContainerMouseMove highcharts.js:165
b.onmousemove highcharts.js:167
问题是,当您使用mouseOver事件时,您会多次捕获此事件,因此也会多次调用序列更新。您应该考虑另一个事件,如单击,它将被调用一次。
您可以先将enableMouseTracking
选项设置为false
以消除错误:
chart.options.plotOptions.pie.enableMouseTracking = false;
相关文章:
- 音频控件在mouseover上显示,在mouseout上淡出
- Node.js v6.2.0类扩展不是函数错误
- Jquery菜单操作不稳定,定位不正确,存在一般错误
- document.open/document.write没有正确地清除chrome中的文档——这是chrome的错误吗
- 试图在引导模式内动态生成图表,得到offsetWidth错误
- 为什么会出现错误;未捕获的类型错误:undefined不是函数;
- 我如何修复包含在captcha的addthis中的错误
- 同样,同样的错误'ahorcado.js:26未捕获类型错误:无法读取属性'beginPath'
- 节点是否需要模块传递带有方括号的arg?这是个错误吗
- Webpack/Rect:遵循egghead.io教程,但出现错误:您可能需要一个合适的加载程序来处理此文件类型
- CKFinder 3为所选文件返回错误的URL
- 同位素库错误:未捕获错误无布局模式包装生产线8
- 铬:“;未捕获的语法错误:意外的标记:"
- 如何通过自己获得Chrome扩展的用户反馈/错误报告
- 相位器状态未捕获参考错误
- /undefined在我的404错误日志中多次出现
- Javascript未捕获语法错误意外的标识符错误
- javascript:如何在antlr生成的Lexer中进行错误处理
- Angularjs工厂注入错误
- Highcharts-更新系列会导致与工具提示相关的错误(mouseOver)