Highcharts面积范围图缩放和工具提示查询

p1iqtdky  于 2023-03-02  发布在  Highcharts
关注(0)|答案(1)|浏览(165)

我正在尝试在高位图区域范围图中完成一些事情:
1.我试图能够放大到图表主要是y轴,我无法做到这一点,有人能建议我如何才能实现,我添加了jsfidle链接下面的样本代码,我试图添加缩放。
1.对于同一图表的工具提示,当我将鼠标悬停在该点上时,我尝试获取该点的值以及该点的范围值。此外,当我将鼠标悬停在该范围上时,我不需要任何工具提示。例如,如果我将鼠标悬停在工具提示中我希望看到的AAL 1A Nov'22 3311.6781801806596的点上

AAL_1A:3311.6781801806596 AAL_1A 95范围:第3066条第798502204227款、第3556条第557858157093款

但我写的东西,我没有看到任何工具提示生成,有人能帮助我如何得到我所期望的
JS小提琴:
一个月一个月一个月一个月

46scxncf

46scxncf1#

1.在缩放的情况下,使用chart.zooming选项。您可以选择缩放类型-xyxy
API参考:https://api.highcharts.com/highcharts/chart.zoominghttps://api.highcharts.com/highcharts/chart.zooming.type
1.当涉及到工具提示时,您需要为每个arearange系列类型设置enableMouseTracking: false,并改进格式化功能。

tooltip: {
 formatter() {
   const {
     series,
     x,
     y
   } = this;
   let text = '';
   series.chart.series.forEach(series => {
     if (this.series.options.name === series.name) {
       text += `<span style=\"color:${this.color}\">●</span> ${series.name}: <b>${this.y}</b><br/>`
     } else if (this.series.options.name === series.options.linkedTo) {
       series.points.forEach(point => {
         if (x === point.x && point.options.high) {
           text += `<span style=\"color:${point.color}\">●</span> ${series.name}: <b>${point.low}</b> - <b>${point.high}</b><br/>`
         }
       })
     }
   })
   return text
 }

},

相关问题