javascript - 使用带有 max 属性的滚动时,标签单击事件在高图条形图中不起作用
问题描述
Highcharts.chart(
chart: {
type: 'column',
renderTo: selector,
events: {
load: function () {
console.log(this)
const axis = this.xAxis[0]
const ticks = axis.ticks
const points = this.series[0].points
points.forEach(function (point, i) {
if (ticks[i]) {
const label = ticks[i].label.element
label.onclick = function () {
alert('label clicked')
}
}
})
}
}
},
title: {
text: titleText
},
xAxis: {
categories: categories,
min: 0,
max: max,
scrollbar: {
enabled: true,
},
},
series: seriesData,
)
解决方案
推荐阅读
- javascript - 将动态函数从父组件传递给孙组件Angular
- python - UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb8 in position 15: invalid start byte when making a python executable
- python - Kivy 解决 Py 和 Kivy 之间的逻辑问题
- c# - 为什么无法通过 OpenXML 获取 excel 文件的单元格值?
- java - SQL Server 插入一个特殊字符串(右侧的空格)并超出列大小。为什么不报错?
- visual-studio-code - 转到实现或转到定义不适用于 Jsx 的 VS CODE
- c# - EF Core:在相关的一对多实体中查询多层次数据的正确方法
- python-3.x - 尝试搜索不同类型的定义 api discord py
- barcode-scanner - 扫描条码和控制led
- python - 可变对象在 Python 中的真正含义