Highcharts 3在一个系列中不能超过1000分 [英] Highcharts 3 cannot render more than 1000 points in one series
问题描述
如果您添加1000点到一系列它呈现OK。
如果您为一个系列添加1001个点,它根本不显示。如果您之后询问系列,则系列上的数据数组为空。
然而,您可以使用1000个点来渲染多个系列 - 因此似乎没有限制在每个图表的总点数。
这是一个jsFiddle,它阐明了这一点: http://jsfiddle.net/YWVHx/47/
$ (function(){
var series1Data = [];
for(var i = 0; i <1000; i ++){
series1Data.push({
x:(new Date())。getTime()+ i * 10000,
y:Math.random()* 100
});
}
var series2Data = [];
//如果您将其更改回1000,则该系列会为(b = b;
x:(new Date())。getTime()+ i * 10000,
y:Math.random()* 100 + 100
});
$('#container')。highcharts({
图表:{
type:'line'
},
title:{
text:'Foo'
},
xAxis:{
type:'datetime'
},
yAxis:{
标题:{
text:null
}
},
工具提示:{
十字符号:true,
共享:true,
valueSuffix :'°C'
},
图例:{
已启用:true
},
系列:[{
name:'1000 Points - I work ;-)',
data:series1Data
},{
name:'1001 Points - I dont :-(',
data:series2Data
} ]
});
});
这是一个强加于目的的限制还是v3的问题?
您应该设置更大的turbothreshold: http://api.highcharts.com/highcharts#plotOptions.series.turboThreshold
After upgrading for Highcharts 2.1.9 to 3.0.0 we found that it seems impossible to render more than 1000 points in one series.
If you add 1000 points to a series it renders ok.
If you add 1001 points to a series it does not render at all. If you interrogate the series afterwards the "data" array on the series is empty.
You can however render multiple series with 1000 points - so there does not seem to be a limitation in terms of the total number of points per chart.
Here is a jsFiddle which illustrates this: http://jsfiddle.net/YWVHx/47/
$(function () {
var series1Data = [];
for (var i = 0; i < 1000; i++) {
series1Data.push({
x: (new Date()).getTime() + i * 10000,
y: Math.random() * 100
});
}
var series2Data = [];
// If you change this back to 1000 the series gets rendered
for (var i = 0; i < 1001; i++) {
series2Data.push({
x: (new Date()).getTime() + i * 10000,
y: Math.random() * 100 + 100
});
}
$('#container').highcharts({
chart: {
type: 'line'
},
title: {
text: 'Foo'
},
xAxis: {
type: 'datetime'
},
yAxis: {
title: {
text: null
}
},
tooltip: {
crosshairs: true,
shared: true,
valueSuffix: '°C'
},
legend: {
enabled: true
},
series: [{
name: '1000 Points - I work ;-)',
data: series1Data
}, {
name: '1001 Points - I dont work :-(',
data: series2Data
}]
});
});
Is this a limitation that was imposed on purpose or is it a problem with v3?
You should set bigger turbothreshold: http://api.highcharts.com/highcharts#plotOptions.series.turboThreshold
这篇关于Highcharts 3在一个系列中不能超过1000分的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!