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 - /
var chart = new Highcharts.StockChart({
chart: {
renderTo: 'container',
height: 120
},
navigator: {
series: {
data: chartData
}
},
series: [{
data: [null],
markers: {
enabled:true
}
}]
});
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/Yrygy/250/
var chart = new Highcharts.StockChart({
chart: {
renderTo: 'container',
height: 120
},
navigator: {
series: {
data: chartData
}
},
series: [{
data: [null],
markers: {
enabled:true
}
}]
});
Share
Improve this question
asked Nov 3, 2014 at 19:44
vikasraovikasrao
951 silver badge10 bronze badges
2
- I think it's because your series data is null. If you add data to the series, the error goes away. – Barbara Laird Commented Nov 3, 2014 at 20:10
- @BarbaraLaird yes but if you do that, the rangeselector bees un-usable. – vikasrao Commented Nov 3, 2014 at 22:50
2 Answers
Reset to default 4Your 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/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)