Highcharts Tootip在多个x轴的错误位置(Highcharts Tootip in wrong location for multiple x axis)

编程入门 行业动态 更新时间:2024-10-27 00:25:13
Highcharts Tootip在多个x轴的错误位置(Highcharts Tootip in wrong location for multiple x axis)

我有一个两个x轴并排的图表,每个都有一个系列。 当我浮动系列1数据时,我看到了工具提示,正如预期的那样。 当我在系列2数据上浮动时,它突出显示该行,但没有工具提示。 但是,如果我将光标向左移动到与系列2数据中的数据相同的高度,但是在系列1数据上方,则工具提示显示2系列信息,并突出显示2系列点。 这是一个例子:

http://jsfiddle.net/q0gphwx2/5/

有没有办法纠正这个?

$(function () { $('#container').highcharts({ chart: { zoomType: 'xy' }, plotOptions : { area : { stacking : 'normal', } }, title: { text: 'Tooltip Hover Anomoly' }, subtitle: { text: 'Float over Series 2 data, then stay at same height, but over series 1. ' }, xAxis: [{ width:300, categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'] },{ left: 400, width: 300, offset:0, categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'] } ], yAxis: [{ // Secondary yAxis gridLineWidth: 0, title: { text: 'Rainfall', style: { color: Highcharts.getOptions().colors[0] } }, labels: { format: '{value} mm', style: { color: Highcharts.getOptions().colors[0] } } }], tooltip: { shared: false }, series: [{ name: 'Series 1', type: 'line', xAxis: 0, stack: 0, data: [10, 20, 30, 40, 50, 40, 30, 20, 10, 20, 30], tooltip: { valueSuffix: ' mm' } }, { name: 'Series 2', type: 'line', xAxis: 1, stack: 1, data: [100, 120, 100, 120, 100, 120, 100, 120, 100, 120, 100, 120], tooltip: { valueSuffix: ' mm' } }] }); });

I've got a chart with two x axis side-by-side, with one series in each. When I float over the Series 1 data, I see the tooltip, as expected. When I float over Series 2 data, it highlights the line, but no tooltip. However, if I move the cursor to the left at the same height as the data in Series 2 data, but above the Series 1 data, the tooltip shows the Series 2 information, and the Series 2 points are highlighted. Here's an example:

http://jsfiddle.net/q0gphwx2/5/

Is there a way to correct for this?

$(function () { $('#container').highcharts({ chart: { zoomType: 'xy' }, plotOptions : { area : { stacking : 'normal', } }, title: { text: 'Tooltip Hover Anomoly' }, subtitle: { text: 'Float over Series 2 data, then stay at same height, but over series 1. ' }, xAxis: [{ width:300, categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'] },{ left: 400, width: 300, offset:0, categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'] } ], yAxis: [{ // Secondary yAxis gridLineWidth: 0, title: { text: 'Rainfall', style: { color: Highcharts.getOptions().colors[0] } }, labels: { format: '{value} mm', style: { color: Highcharts.getOptions().colors[0] } } }], tooltip: { shared: false }, series: [{ name: 'Series 1', type: 'line', xAxis: 0, stack: 0, data: [10, 20, 30, 40, 50, 40, 30, 20, 10, 20, 30], tooltip: { valueSuffix: ' mm' } }, { name: 'Series 2', type: 'line', xAxis: 1, stack: 1, data: [100, 120, 100, 120, 100, 120, 100, 120, 100, 120, 100, 120], tooltip: { valueSuffix: ' mm' } }] }); });

最满意答案

不幸的是,这是已知的bug,我们的开发人员在这里报道

Unfortunately it is known bug, reported to our developers here

更多推荐

本文发布于:2023-08-01 11:43:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1357762.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:多个   错误   位置   Tootip   Highcharts

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!