我们使用的是一个高图表列图,与这个例子完全一样:
http://jsfiddle.net/gh/get/jquery/1.7.2/highslide-software/highcharts.com/tree/master/samples/highcharts/data/rows/
$(function () {
$('#container').highcharts({
chart: {
type: 'column'
},
title: {
text: 'Data input as row arrays'
},
data: {
rows: [
[null, 'Ola', 'Kari'], // series names
['Apples', 1, 5], // category and values
['Pears', 4, 4], // category and values
['Oranges', 3, 2] // category and values
]
}
});});
因此,对于图表数据,我们使用的不是序列,而是数据行。
是否有一种方法可以向这个列图表中添加一个错误栏,以及如何做到这一点?
谢谢,沃尔特
发布于 2015-03-05 10:02:35
我自己已经为这件事挣扎了一段时间了,我终于明白了。诀窍是定义这个系列并给他们一个id。之后,您可以将错误条链接到正确的系列。
$(function () {
$('#container').highcharts({
chart: {
type: 'column'
},
title: {
text: 'Data input as row arrays'
},
tooltip: {
shared: true
},
data: {
rows: [
[null, 'Ola', 'Kari'], // series names
['Apples', 1, 5], // category and values
['Pears', 4, 4], // category and values
['Oranges', 3, 2] // category and values
]
},
series: [
{
id: '0'
},
{
id: '1'
},
{
type: 'errorbar',
data: [[0, 3], [1, 3],[2, 1]],
linkedTo: '0'
},
{
type: 'errorbar',
data: [[0, 6], [2, 5],[3, 2]],
linkedTo: '1'
}
]
});});
参见更新后的小提琴示例:http://jsfiddle.net/6k7ee0cu/1/
https://stackoverflow.com/questions/28873376
复制相似问题