我正在尝试基于不规则时间而不是使用类别来构建带有 xAxis 误差条的样条曲线,但我遇到了一些麻烦。
这是一个例子:http: //jsfiddle.net/Zj2Lp/4/
知道如何实现吗?
先感谢您
代码在这里:
var chart;
$(function() {
$('#container').highcharts({
chart: {
zoomType: 'xy',
},
title: {
text: 'Temperature vs Rainfall'
},
xAxis: [{
type: 'datetime'
}],
/*
xAxis: [{
categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
}],
*/
yAxis: [{ // Primary yAxis
labels: {
format: '{value} °C',
style: {
color: Highcharts.getOptions().colors[0]
}
},
title: {
text: 'Temperature',
style: {
color: Highcharts.getOptions().colors[0]
}
}
}],
tooltip: {
shared: true
},
series: [{
name: 'Temperature',
type: 'spline',
data: [
[Date.UTC(2014, 5, 10), 7.0],
[Date.UTC(2014, 5, 11), 26.5],
[Date.UTC(2014, 5, 12), 9.6]
],
tooltip: {
pointFormat: '<span style="font-weight: bold; color: {series.color}">{series.name}</span>: <b>{point.y:.1f}°C</b> '
}
}, {
name: 'Temperature error',
type: 'errorbar',
data: [
[Date.UTC(2014, 5, 10), [6, 8]],
[Date.UTC(2014, 5, 11), [26.1, 27.8]],
[Date.UTC(2014, 5, 12), [7.6, 10.0]]
],
tooltip: {
pointFormat: '(error range: {point.low}-{point.high}°C)<br/>'
}
}]
});