Hi Martin,
Did you have any luck with this? I'm having trouble getting the select + zoom functionality to work. I also have multiple yaxes in my graph, but I've set select mode to
selection: { mode: 'x' }
..so I didn't think it would matter. My 'plotselected' event is firing, and if I was reading the plugin docs correctly, I *think* that all you need to do is call setSelection like so:
plotSelected: function (e, ranges) {
console.log('before: ', this.plot.getSelection(), ranges);
this.plot.setSelection(ranges, true);
console.log('after: ', this.plot.getSelection());
}
But this doesn't work for me. If I select, and then release, the event fires, and it calls the plugin's setSelection function and nothing happens...no errors, no change in x-axis boundaries or anything.
The range objects are identical in the 'before' / 'after' console.
I re-wrote my selected handler like this:
plotSelected: function(e, ranges) {
this.plot = $.plot(this.chart, data, $.extend(true, {}, this.options, { xaxis: ranges.xaxis }) );
}
It re-draws the chart but no xaxis change at all. I inspect the range I pass into $.plot in the options, and it is correct -- it is in fact a smaller selection than the full x-range, but it doesn't seem to work, so I'm continuing to step debug into the flot source to find the issue....but It would be awesome if anyone on the group has a clue what might be going wrong here.
event.layerX and event.layerY are broken and deprecated in WebKit. They will be removed from the engine in the near future.
I'm not sure what the exact sequence is to get it there, but I can consistently make it happen.
Nevertheless, in the problem indicated above, where the selection isn't zooming in, there are absolutely zero errors/warnings in the console.
Regards,
Davis