$(document).ready(function() {
var chart = {
type: 'columnrange',
inverted:true
};
var title = {
text: 'Highcharts图表之区间柱形图'
};
var subtitle = {
text: 'ipkd.cn'
};
var xAxis = {
categories: ['周一','周二','周三','周四','周五','周六','周日']
};
var yAxis = {
title: {
text: '访问量'
}
};
var plotOptions = {
columnrange: {
dataLabels: {
enabled: true,
formatter: function () {
return this.y + '\xB0C';
}
}
}
};
var credits = {
enabled: false
};
var series= [{
name: '访问量',
data: [
[-3.5, 9.4],
[-1.4, 19.9],
[0.0, 22.6],
[2.9, 29.5],
[9.2, 30.7],
[7.3, 26.5],
[4.4, 18.0]
]
}];
var json = {};
json.chart = chart;
json.title = title;
json.subtitle = subtitle;
json.xAxis = xAxis;
json.yAxis = yAxis;
json.series = series;
json.plotOptions = plotOptions;
json.credits = credits;
$('#myChart').highcharts(json);
});
点击运行 》