hi,
I found how make the json file
[[[1323199800000,5.5000011111111],[1323200100000,5.4444438888889],[1323200400000,5.2777777777778],[1323200700000,5.2222233333333],[1323201000000,5.1666661111111],[1323201300000,5.1666661111111],[1323201600000,5.0555544444444],[1323201900000,5.0555544444444],[1323202200000,5.2777777777778],[1323202500000,5.5000011111111],[1323202800000,5.4444438888889],[1323203100000,5.1111116666667],[1323203400000,4.7777766666667],[1323203700000,4.6666677777778],[1323204000000,4.6666677777778],[1323204300000,4.6111105555556],[1323204600000,4.5555561111111],[1323204900000,4.5555561111111],[1323205200000,4.6666677777778],[1323205500000,4.7222222222222]
],
[[1323199800000,30.014],[1323200100000,30.014],[1323200400000,30.014],[1323200700000,30.014999],[1323201000000,30.014],[1323201300000,30.011999],[1323201600000,30.016001],[1323201900000,30.014],[1323202200000,30.011999],[1323202500000,30.014999],[1323202800000,30.014999],[1323203100000,30.013],[1323203400000,30.011999],[1323203700000,30.011],[1323204000000,30.01],[1323204300000,30.009001],[1323204600000,30.007999],[1323204900000,30.011],[1323205200000,30.007999],[1323205500000,30.009001]
]]I also tried to add the new serie
- Code: Select all
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title></title>
<script type="text/javascript" src="../file_comuni/javascript/jquery/jquery-1.7.js"></script>
<script type="text/javascript" src="../file_comuni/javascript/highchart/js/highcharts.js"></script>
<script type="text/javascript" src="../file_comuni/javascript/highchart/js/themes/gray.js"></script>
<script type="text/javascript">
/**
* Request data from the server, add it to the graph and set a timeout to request again
*/
var chart;
function requestData() {
$.getJSON('new_file.php',
function (data) {
var series = chart.series[0];
series.setData(data);
}
);
}
$(document).ready(function() {
chart = new Highcharts.Chart({
chart: {
renderTo: 'container',
defaultSeriesType: 'spline',
marginRight: 130,
marginBottom: 25,
events: { load: requestData }
},
title: {
text: 'First 20 temperature from my Davis Vantage Pro 2',
x: -20 //center
},
xAxis: {
type: 'datetime',
},
yAxis: {
title: {
text: 'Temperature °C'
},
plotLines: [{
value: 0,
width: 1,
color: '#808080'
}]
},
tooltip: {
formatter: function() {
return '<b>'+ this.series.name +'</b><br/>'+
Highcharts.dateFormat('%d-%m-%Y %H:%M', this.x)+'<br/>'+
this.y;
}
},
series: [{
name: 'Temperature',
data: []
}]
});
chart.addSeries({
name: 'pressure',
data: [],
});
});
</script>
</head>
<body>
<div id="container" style="width: 1000px; height: 400px; margin: 0 auto"></div>
</body>
</html>
but I get displyed only the first serie
any hint'
Regards
Ugo