ฉันมองเห็นแกน 2 แกน แต่ฉันจะขยายแกนที่สองได้อย่างไร ต้องใส่โค้ดตรงไหน? ฉันได้ข้อมูลจากฐานข้อมูลโดยใช้ json.php ซึ่งฉันไม่ได้รวมเอาไว้ เพราะมั่นใจว่าได้ผลลัพธ์...อย่างที่บอกไปว่ามองเห็นเส้นได้........
function InitHighChart()
{
$("#chart").html("Wait, Loading graph...");
var options = {
chart: {
renderTo: 'chart',
borderColor: '#a1a1a1',
borderWidth: 2,
borderRadius: 13,
alignTicks: false,
height: 550
},
credits: {
enabled: false
},
title: {
text: 'Ενεργός Ισχύς / Τάση',
x: -20
},
xAxis: {
categories: [{}],
labels: {
step: 15,
rotation: -75
}
},
yAxis: [{ // Primary yAxis
labels: {
format: '{value} MWatt',
},
title: {
text: 'Ενεργός Ισχύς',
}
}, { // Secondary yAxis
title: {
text: 'Τάση',
},
labels: {
format: '{value} V',
},
opposite: true
}],
tooltip: {
formatter: function() {
var s = '<b>'+ this.x +'</b>';
$.each(this.points, function(i, point) {
s += '<br/>'+point.series.name+': '+point.y;
});
return s;
},
shared: true
},
series: [{},{}]
};
$.ajax({
url: "json.php",
data: 'show=impression',
type:'post',
dataType: "json",
success: function(data){
options.xAxis.categories = data.datetime;
options.series[0].name = '...';
options.series[0].data = data.ActiveData;
options.series[1].name = '...';
options.series[1].data = data.VoltageData;
var chart = new Highcharts.Chart(options);
},
});
}