function chat1() {
$('#container1').highcharts({
credits: {
enabled: false
},
title: {
text: '大标题'
},
subtitle: {
text: '小标题'
},
xAxis: {
categories: categories,
crosshair: true
},
yAxis: [{ // 第一条Y轴
labels: {
format: '{value} 元',
style: {
color: Highcharts.getOptions().colors[1]
}
},
title: {
text: '金额(元)',
style: {
color: Highcharts.getOptions().colors[1]
}
},
opposite: true
}, { // 第二条Y轴
labels: {
format: '{value} 位',
style: {
color: Highcharts.getOptions().colors[0]
}
},
title: {
text: '人数(位)',
style: {
color: Highcharts.getOptions().colors[0]
}
}
}],
series: [{
type: 'column',
name: '金额1',
data: []
}, {
type: 'column',
name: '金额2',
data: []
}, {
type: 'spline',
name: '人数1',
yAxis: 1,
data: []
}, {
type: 'spline',
yAxis: 1,
name: '人数2',
data: []
}],
tooltip: {
shared: true,
pointFormatter: function () {
var html = this.series.name + ': ' + this.y.toFixed(2) + '<br/>';
return html;
}
}
});
}