我有一个分为几类的柱形图。我想在每个条上放置误差线,但我不确定如何执行此操作(或在哪里查找)。到目前为止,这是我的代码:
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>SIS</title>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
<style type="text/css">
${demo.css}
</style>
<script type="text/javascript">
$(function () {
$('#container').highcharts({
title: {
text: 'Search Inefficiency'
},
xAxis: {
categories: ['Experiment 1', 'Experiment 2', 'Experiment 3', 'Experiment 4'],
},
yAxis: {
reversedStacks: false,
min: 0,
title: {
text: 'Search inefficiency',
align: 'middle'
},
labels: {
overflow: 'justify'
}
},
legend: {
layout: 'vertical',
align: 'right',
verticalAlign: 'top',
x: -40,
y: 80,
floating: false,
borderWidth: 1,
backgroundColor: ((Highcharts.theme && Highcharts.theme.legendBackgroundColor) || '#FFFFFF'),
shadow: true
},
series: [ {
name: '0 degrees',
type: 'column',
data: [0.43,0.36,0.53,0.52]
}, {
name: '45 degrees',
type: 'column',
data: [0.94,1.00,1.22,0.87]
}, {
name: '90 degrees',
type: 'column',
data: [1.01,1.13,1.45,1.08]
}, {
name: '135 degrees',
type: 'column',
data: [0.78,0.95,1.36,1.00]
},{
name: '180 degrees',
type: 'column',
data: ["",0.48,0.83,0.62]
}]
// I want to retain the category clustering and give each column an error bar. Not sure how to do it with the following error bar example:
// series: [{
// name: 'Rainfall',
// color: '#4572A7',
// type: 'column',
// data: [49.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4]
// }, {
// name: 'Rainfall error',
// type: 'errorbar',
// data: [[48, 51], [68, 73], [92, 110], [128, 136], [140, 150], [171, 179], [135, 143], [142, 149], [204, 220], [189, 199], [95, 110], [52, 56]]
// }]
});
});
</script>
</head>
<body>
<script src="../../js/highcharts.js"></script>
<script src="../../js/modules/exporting.js"></script>
<div id="container" style="min-width: 310px; max-width: 800px; height: 400px; margin: 0 auto"></div>
</body>
</html>