Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Highcharts navigator error: Invalid negative value for <rect> attribute width

Does anyone know why I am seeing this error - "error: Invalid negative value for attribute width" while using the Highstock navigator? Please see this JsFiddle for my code - http://jsfiddle.net/Yrygy/250/

var chart = new Highcharts.StockChart({
    chart: {
        renderTo: 'container',
        height: 120
    },
    navigator: {
        series: {
            data: chartData
        }
    },
    series: [{
        data: [null],
        markers: {
            enabled:true
        }
    }]
});
like image 329
vikasrao Avatar asked May 19 '26 13:05

vikasrao


1 Answers

Your data is all on one day. The minRange of highstock is one day by default. So, the reason it appears your rangeselector is unusable when you have your data correctly defined within the series is that you are already zoomed into one day.
Move the data from the navigator to a series and change the xAxis minRange to be a smaller number (I choose 1 minute)

var chart = new Highcharts.StockChart({
    chart: {
        renderTo: 'container'
    },
    series: [{
        data: chartData,
        markers: {
            enabled:true
        }
    }],
    xAxis : {
        minRange: 60 * 1000 // one minute
    },
});

http://jsfiddle.net/blaird/Yrygy/256/

like image 71
Barbara Laird Avatar answered May 24 '26 17:05

Barbara Laird



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!