내가 자바 스크립트에 새로 온 다음과 같은 코드 작업 있어요 : 지금 하나 개의 차트에 그래프를 모두 싶어Highstock 데이터 업데이트해서 getJSON
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Temperatur</title>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
<style type="text/css">
${demo.css}
</style>
<script type="text/javascript">
$(function() {
$.getJSON('sqltojson.php', function (data) {
// Create the chart
$('#container').highcharts('StockChart', {
rangeSelector: {
allButtonsEnabled: true,
buttons: [{
type: 'minute',
count: 60,
text: 'hour',
dataGrouping: {
forced: true,
units: [['minute', [1]]]
}
}, {
type: 'minute',
count: 360,
text: '6 hour',
dataGrouping: {
forced: true,
units: [['minute', [1]]]
}
}, {
type: 'all',
text: 'all',
dataGrouping: {
forced: true,
units: [['minute', [1]]]
}
}],
buttonTheme: {
width: 60
},
selected: 0
},
title: {
text: 'Temperatur'
},
series: [{
name: 'Temperatur',
type: 'spline',
data: data,
color: '#0000FF',
tooltip: {
valueSuffix: '°C'
}
}]
});
});
});
$(function() {
$.getJSON('sqltojson2.php', function (data) {
// Create the chart
$('#container2').highcharts('StockChart', {
rangeSelector: {
allButtonsEnabled: true,
buttons: [{
type: 'minute',
count: 60,
text: 'hour',
dataGrouping: {
forced: true,
units: [['minute', [1]]]
}
}, {
type: 'minute',
count: 360,
text: '6 hour',
dataGrouping: {
forced: true,
units: [['minute', [1]]]
}
}, {
type: 'all',
text: 'all',
dataGrouping: {
forced: true,
units: [['minute', [1]]]
}
}],
buttonTheme: {
width: 60
},
selected: 0
},
title: {
text: 'Luftfeuchte'
},
series: [{
name: 'Luftfeuchte',
type: 'spline',
data: data,
color: '#FF0000',
tooltip: {
valueSuffix: '%'
}
}]
});
});
});
</script>
</head>
<body>
<script src="https://code.highcharts.com/stock/highstock.js"></script>
<script src="https://code.highcharts.com/stock/modules/exporting.js"></script>
<div id="container" style="height: 400px; min-width: 310px"></div>
<div id="container2" style="height: 400px; min-width: 310px"></div>
</body>
</html>
을하고 분마다 업데이트해야합니다. 순간에는 두 개의 PHP 스크립트가 있습니다. 하나는 [타임 스탬프, 온도]이고, 다른 하나는 [타임 스탬프, 습도]입니다.
여기에서 찾은 몇 가지 코드 스 니펫을 시도했지만, 현재 자바 지식이 없기 때문에 내 필요에 맞게 변경할 수 없습니다.
누군가 내가 시도해야 할 힌트를 주거나, 내가해야 할 일을 설명 할 수있는 곳을 찾을 수 있습니까?
미리 감사드립니다.