问题
I am currently working on the highchart and I wish to implement a feature that when you click mouse and drag it over the chart, a tooltip will show up to indicate the start and end date (x-Axis) of your selection.
Currently, I can only find events.selection, but you need to release the mouse by triggering this event. Is there a way to achieve a "area selection" function without releasing mouse?
Any hint will be appreciated!
Thanks
回答1:
Update While I was looking for the plug-in I used( written by Torstein Hønsi) I got this fiddle http://jsfiddle.net/highcharts/AyUbx/
following code is an example how I used dragging/drop in plotOption
plotOptions : {
series : {
cursor : 'ns-resize',
point : {
events : {
drag : function(e) {
$('#drag')
.html(
'Dragging <b>'
+ this.series.name
+ '</b>, <b>'
+ this.category
+ '</b> to <b>'
+ Highcharts
.numberFormat(
e.newY,
2)
+ '</b>');
},
drop : function() {
$('#drop')
.html(
'In <b>'
+ this.series.name
+ '</b>, <b>'
+ this.category
+ '</b> was set to <b>'
+ Highcharts
.numberFormat(
this.y,
2)
+ '</b>');
}
}
},
stickyTracking : false
},
column : {
stacking : 'normal'
}
}
回答2:
refer this http://forum.highcharts.com/highcharts-usage/is-there-a-start-pan-zoom-event-t33369/
informative and useful discussion
来源:https://stackoverflow.com/questions/32528010/highchart-select-an-area-to-show-some-info-by-clicking-and-drag-mouse-but-not-re