$(document).ready(function() {
var chart = {
type: 'column'
};
var title = {
text: 'Highcharts图表之堆叠组柱形图'
};
var xAxis = {
categories: ['周一','周二','周三','周四','周五','周六','周日']
};
var yAxis ={
allowDecimals: false,
min: 0,
title: {
text: 'Number of fruits'
}
};
var plotOptions = {
column: {
stacking: 'normal'
}
};
var credits = {
enabled: false
};
var series= [{
name: '堆叠一',
data: [49, 71, 106, 129, 144, 176, 200]
}, {
name: '堆叠二',
data: [83, 78, 98, 93, 106, 84, 105]
}];
var json = {};
json.chart = chart;
json.title = title;
json.xAxis = xAxis;
json.yAxis = yAxis;
json.plotOptions = plotOptions;
json.credits = credits;
json.series = series;
$('#myChart').highcharts(json);
});
点击运行 》