答案 0 :(得分:0)
请更新您的Google Chrome。 这段代码最适合您:
$(function () {
var data = {
"xCategories": ["Oct 13","Nov 13","Dec 13","Jan 14"],
"ySeries": [
{
"name": "Product1",
"data": [11023.06902288,1059.48907912,1269.79964983,1620.3101287],
"type": "column"
},
{
"name": "Total volume",
"data": [2185819284,2101885633.7272727,2553791958.4090905,3229867446],
"type": "spline",
"yAxis": 1
}
],
};
$('#container').highcharts({
chart: {
animation: false,
type: 'column'
},
title: {text: null},
xAxis: {
title: {text: 'month'},
categories : data.xCategories
},
yAxis: [{
title: {text: 'Monthly spend ($)'}
},{
title: {text: 'volume'}, opposite: true
}],
tooltip: {
shared: true,valueDecimals: 2,valuePrefix: '$'
},
plotOptions: {
column: {stacking: 'normal'},
spline: {
tooltip: {valuePrefix: '', valueSuffix: ' units.', valueDecimals: 0}
},
series : {animation: false}
},
series: data.ySeries
});
});
<script
src="https://code.jquery.com/jquery-2.2.4.min.js"
integrity="sha256-BbhdlvQf/xTY9gja0Dq3HiwQF8LaCRTXxZKRutelT44="
crossorigin="anonymous"></script>
<script src="http://code.highcharts.com/highcharts.js"></script>
<script src="http://code.highcharts.com/modules/exporting.js"></script>
<div id="container" style="min-width: 310px; height: 400px; margin: 0 auto"></div>