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/ –