Is it possible to render a zoomable charts and have it already zoomed. I'm using a scatter plot which is zoomable on the x and y axis and would like to have it rendered already zoomed in to certain values.
Is there any default zooming options I can set when defining the chart?
Here is a working example of the chart: Chart Example
$('#container').highcharts({
chart: {
type: 'scatter',
zoomType: 'xy'
}...
The chart.zoom
function is available (but not intended for this use), but normally takes quite a few parameters from a drag-event. Faking it upon chart creation could at minimum be done like this:
$('#container').highcharts({
// ...
}, function() {
this.zoom({
xAxis: [{ min: 25, max: 30, axis: this.xAxis[0] }],
yAxis: [{ min: 0, max: 300, axis: this.yAxis[0] }]
});
});
See this CodePen for an example. If you do a manual selection I've logged the original input that function would take.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With