[英]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? 有没有人知道为什么我看到这个错误 - “错误:属性宽度的负值无效”使用Highstock导航器? Please see this JsFiddle for my code - http://jsfiddle.net/Yrygy/250/ 请参阅这个JsFiddle我的代码 - 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. highstock的minRange默认为一天。 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. 因此,当您在系列中正确定义数据时,看起来您的rangeselector无法使用的原因是您已经放大了一天。
Move the data from the navigator to a series and change the xAxis minRange to be a smaller number (I choose 1 minute) 将数据从导航器移动到一个系列,并将xAxis minRange更改为较小的数字(我选择1分钟)
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/ http://jsfiddle.net/blaird/Yrygy/256/
I have this error when I used navigator.series.setData()
. 我使用navigator.series.setData()
时出现此错误。 All you need is set min and max values with chart.xAxis[0].setExtremes(min, max)
您只需使用chart.xAxis[0].setExtremes(min, max)
设置最小值和最大值
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.