I have already set up working Highstock chart that is presenting some data.
Now I was asked by user if it is possible to select points with mouse drag. I started reading API and googling and found couple of solutions. Like those for example:
http://jsfiddle.net/Lqcmf7ao/
http://jsfiddle.net/gh/get/jquery/1.7.2 ... on-points/
First move was to implement Event 'selection' into chart. I added it with this code:
Code: Select all
$scope.chart = new Highcharts.Chart(Config);
$scope.chart.events = {
selection: function (event) {
console.log("test");
},
click: function (event) {
console.log("test1");
}
};
$scope.chart.zoomType = 'xy';
And the events does not work at all. I was expecting that it will zoom my chart and return test/test1 to console. It doesn't.
And additionaly. I implemented single-click selection with this code:
Code: Select all
$scope.chart.addSeries({
allowPointSelect: true,
point: {
events: {
select: function(event){
console.log(event);
}
},
}
So events are working at all. They just don't work on chart in general, only in series.