score:30

Accepted answer

you can use the setextremes function to change the zoom. http://jsfiddle.net/quvda/382/

for a timeseries chart with day-by-day information, you need to use the utc representation of the date:

var d = new date();
chart.xaxis[0].setextremes(
    date.utc(d.getfullyear(), d.getmonth(), d.getdate() - 7),
    date.utc(d.getfullyear(), d.getmonth(), d.getdate()));

score:0

there is another option if you try

var max_in = 100; //the highest y value you have in your series data;
var min_in = 41 ;//the lowest y value you have in your series data;

yaxis=this.yaxis[0];
yaxis.options.max = max_in;
yaxis.options.min = min_in;

score:5

updated official fiddle for solution, guys: http://jsfiddle.net/gh/get/jquery/1.7.2/highslide-software/highcharts.com/tree/master/samples/stock/members/axis-setextremes/

$(function() {
    $('#container').highcharts('stockchart', {

        rangeselector: {
            selected: 1
        },

        series: [{
            name: 'usd to eur',
            data: usdeur
        }]
    });

    $('#button').click(function() {
        var chart = $('#container').highcharts();
        chart.xaxis[0].setextremes(
            date.utc(2007, 0, 1),
            date.utc(2007, 11, 31)
        );
    });
});

Related Query

More Query from same tag