0
此输入将与highcharts工作得很好:Highchart.js可变长度的输入不起作用
data1 = [[2, 3, 3.5, 4], [1, 1.5, 2, 3]]
但这不会:
data2 = [[2, 3, 3.5, 4, 4.5], [1, 1.5, 2, 3]]
这里唯一的区别是,在第一项目,还有一个数据点。为什么highchart无法从中创建boxplot?我想所有它需要生成像中值,四分位数和最小值和最大值的箱形图也都在第二个数据集中。
这是我的代码:
dt = [
[760, 801, 848, 895, 930],
[733, 853, 939, 980, 1080],
[714, 762, 817, 870, 918],
[724, 802, 806, 871, 950],
[834, 836, 864, 882, 910]
];
Highcharts.chart('boxcontainer', {
chart: {
type: 'boxplot'
},
title: {
text: 'Highcharts box plot styling'
},
legend: {
enabled: false
},
xAxis: {
categories: ['1', '2', '3', '4', '5'],
title: {
text: 'Experiment No.'
}
},
yAxis: {
title: {
text: 'Observations'
}
},
plotOptions: {
boxplot: {
fillColor: '#F0F0E0',
lineWidth: 2,
medianColor: '#0C5DA5',
medianWidth: 3,
stemColor: '#A63400',
stemDashStyle: 'dot',
stemWidth: 1,
whiskerColor: '#3D9200',
whiskerLength: '20%',
whiskerWidth: 3
}
},
series: [{
name: 'Observations',
data: dt
}]
});
我怎样才能解决这个问题?
你能不能跟我们分享一些代码吗? – Core972
我把你的代码粘贴到jsfiddle。看起来'data1'不能在boxplot和'data2'中工作:http://jsfiddle.net/kkulig/yv8zdycg/ –