简体   繁体   中英

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
        }
    }]
});

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/

I have this error when I used navigator.series.setData() . All you need is set min and max values with chart.xAxis[0].setExtremes(min, max)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM