看起来 highcharts 线图中的鼠标事件跟踪存在一些错误,我不确定它是否存在错误,几天前我在同一问题上又发了一篇文章,如何在 Highcharts 中更正鼠标事件,其中一个highcharts支持的工程师,建议对x轴进行排序,我按照他的建议做了,但结果是我在实际中不能接受的结果
这是Fiddle的链接,请查看
1)好的模式yaxis排序鼠标事件不起作用--->好
<script src="http://code.highcharts.com/highcharts.js"></script>
<div id="container" style="height: 400px"></div>
$(function () {
$('#container').highcharts({
title: {
text: 'Y axes reversed'
},
yAxis: {
reversed: true
},
series: [{
data:[
[ 25.290,1.000 ],
[ 25.240,2.000 ],
[ 25.210,3.000 ],
[ 25.190,4.000 ],
[ 25.180,5.000 ],
[ 25.170,6.000 ],
[ 25.160,7.000 ],
[ 25.310,8.000 ],
[ 25.210,9.000 ],
[ 25.170,10.000 ],
[ 25.160,11.000 ],
[ 25.160,12.000 ],
[ 25.150,13.000 ],
]
}]
});
});
2 ) 坏模式 xaxis 排序鼠标事件正在工作 --->坏
<script src="http://code.highcharts.com/highcharts.js"></script>
<div id="container" style="height: 400px"></div>
$(function () {
$('#container').highcharts({
title: {
text: 'Y axes reversed'
},
xAxis :{opposite: true, },
yAxis: {
reversed: true
},
series: [{
data:[
[ 25.150,13.000 ],
[ 25.160,12.000 ],
[ 25.160,11.000 ],
[ 25.160,7.000 ],
[ 25.170,6.000 ],
[ 25.170,10.000 ],
[ 25.180,5.000 ],
[ 25.190,4.000 ],
[ 25.210,9.000 ],
[ 25.210,3.000 ],
[ 25.240,2.000 ],
[ 25.290,1.000 ],
[ 25.310,8.000 ],
]
}]
});
});
请有人帮我解决问题,这是我迄今为止尝试过的我在小提琴上的尝试,在这里你可以看到用散点图排序的相同数据 y 轴鼠标事件正在工作但不能使用线图。
<script src="http://code.highcharts.com/highcharts.js"></script>
<div id="container" style="height: 400px"></div>
var chart = new Highcharts.Chart({
chart: {
renderTo: 'container',
defaultSeriesType: 'scatter'
},
title :{
text:'overlap, scatter points on line for mouse events, trying to keep same color and legend so that mouse event might work, do not know how to do it'
},
xAxis : { opposite : true },
yAxis : { reversed : true },
series: [{
name: '07-Jan-2006 07:30:00 AM' ,
data:[
[ 25.290,1.000 ],
[ 25.240,2.000 ],
[ 25.210,3.000 ],
[ 25.190,4.000 ],
[ 25.180,5.000 ],
[ 25.170,6.000 ],
[ 25.160,7.000 ],
[ 25.310,8.000 ],
[ 25.210,9.000 ],
[ 25.170,10.000 ],
[ 25.160,11.000 ],
[ 25.160,12.000 ],
[ 25.150,13.000 ],
]
},{
name: '07-Jan-2006 07:30:00 AM' ,
type : 'line',
marker: {enabled:false},
enableMouseTracking: false,
data:[
[ 25.290,1.000 ],
[ 25.240,2.000 ],
[ 25.210,3.000 ],
[ 25.190,4.000 ],
[ 25.180,5.000 ],
[ 25.170,6.000 ],
[ 25.160,7.000 ],
[ 25.310,8.000 ],
[ 25.210,9.000 ],
[ 25.170,10.000 ],
[ 25.160,11.000 ],
[ 25.160,12.000 ],
[ 25.150,13.000 ],
]
}]
});