私はハイチャートを初めて使いましたが、すでに気に入っています。json、php、mysqlを使用していくつかの縦棒グラフを作成しました(例を示します)。今、jsonを使用して列と線でグラフを作成したいと思います。誰が私がそれを行うべきか教えてもらえますか??
$(function () {
var chart;
$(document).ready(function() {
$.getJSON("DataKwhDagCum.php", function(json) {
chart = new Highcharts.Chart({
chart: {
renderTo: 'container',
type: 'column',
marginRight: 130,
marginBottom: 25
},
title: {
text: 'In (Enexis) vs Out (Zonnestroom)',
x: -20 //center
},
subtitle: {
text: '',
x: -20
},
xAxis: {
categories: ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20','21', '22', '23', '24', '25', '26', '27', '28', '29', '30', '31']
},
yAxis: {
title: {
text: 'Amount'
},
plotLines: [{
value: 0,
width: 1,
color: '#808080'
}]
},
tooltip: {
formatter: function() {
return '<b>'+ this.series.name +'</b><br/>'+
this.x +': '+ this.y;
}
},
legend: {
layout: 'vertical',
align: 'right',
verticalAlign: 'top',
x: -10,
y: 100,
borderWidth: 0
},
series: json
});
});
});
});