我正在尝试设置缩放的开始日期和结束日期,而不是图表的开始最小值和最大值。我没有发现问题。有人可以帮忙吗?它在 VueJS 中
plugins: {
datalabels: {
display: false
},
zoom: {
zoom: {
enabled: true,
drag: true,
mode: "x",
sensitivity: 100,
speed: 10,
onZoom: this.onZoom
}
}
}
onZoom({ chart }) {
console.log(chart)
const start = chart.scales.time.min; // I have to change this
const end = chart.scales.time.max; // I have to change this
console.log(start, end)
this.$emit("interval", { start, end });
}
例如,我的图表从 12:00 开始,到 16:00 结束。我在 14:00 到 15:00 之间单击,我想获取这些值并将其提供给我的父母。