更新时间:2023-11-14 19:22:10
You could edit event.chartX
after coordiantes are found in each chart by adding:
event.chartX = (event.chartX+600) % 200;
Adding 600
to avoid negative values and %
by 200
because each chart has 200px
of width.
Example: http://jsfiddle.net/fzda6z8p/
Relevant part of code:
$('#container').bind('mousemove touchmove touchstart', function (e) {
var chart,
point,
i,
event;
for (i = 0; i < Highcharts.charts.length; i = i + 1) {
chart = Highcharts.charts[i];
event = chart.pointer.normalize(e.originalEvent); // Find coordinates within the chart
event.chartX = (event.chartX+600) % 200;
point = chart.series[0].searchPoint(event, true); // Get the hovered point
if (point) {
point.highlight(e);
}
}
});