Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Highstock Navigator always starts from 1970-1-1

I have problem with Highstock navigator always displaying 1970-1-1 as a start point when creating dynamic series and data... does anyone have encountered this issue and has some workarounds?

Here is an example: http://jsfiddle.net/sokarovski/SRtvn/

var $container = $('.canvas');
var chart = new Highcharts.StockChart({
    chart: {
        renderTo: $container[0]
    },
    xAxis: {
        type: 'datetime' , 
        ordinal: false 
    } 
});

chart.addSeries({
    data: [
        [Date.UTC(2013,1,1), 0],
        [Date.UTC(2013,1,5), 10],
        [Date.UTC(2013,1,15), 15],
        [Date.UTC(2013,2,5), 20],
        [Date.UTC(2013,2,28), 25],
        [Date.UTC(2013,3,3), 30],
    ]        
});

//I tried to fix it with this also but it does not help
chart.xAxis[0].setExtremes(Date.UTC(2013,1,1), Date.UTC(2013,3,3));
like image 442
thejigsaw Avatar asked Mar 06 '13 13:03

thejigsaw


1 Answers

It is caused, that navigator doesn't work properly, when you try to addSeries / addPoint to chart which have no series / data. This bug is reported here:

https://github.com/highslide-software/highcharts.com/issues/624

like image 62
Sebastian Bochan Avatar answered Sep 24 '22 14:09

Sebastian Bochan