Highcharts - Realtime: Difference between revisions

From Cumulus Wiki
Jump to navigationJump to search
no edit summary
No edit summary
No edit summary
{{AddOnBanner|name=Realtime_Highchart|type=PHP,AJAX|author=Mark Crossley|contact='MCrossley' via the forum|updated=2829 November 2012|version=0.1.0}}
 
= Dynamically Updating a Highcharts Graph from Realtime.txt =
Alternatively Kevin at [http://cumulus.tnetweather.com/projects/ TNET Weather] has created a PHP script to create such a log file. The batch file is simple and creates a limited length log file, the TNET scripts typically create much larger log files.
 
= The result =
 
You should end up with a default graph looking something like this [[Image:RealtimeHigharts.JPG]]
[[File:RealtimeHigharts.JPG]]
 
= Configuring the graph =
 
For consistency, the graphed data ranges are all referred to by their equivalent Cumulus webtag names.
 
The supplied files are configured to display the current rainfall, atmospheric pressure, average wind speed, and temperature. If you want to change this there are three areas of the realtimeCumulus.js file that will require editing:
 
*parseRealtime function: Change or amend each of the "chart.series[].addPoint()" lines. The order here must match the options.series changes below...
*options.yAxis object: Change or amend each yAxis scale to match your desired data series.
*options.series array: Change or amend each data series to match your desired data series. Note the reference back to the corresponding yAxis number.
*$.ajax url: Change or amend the required data series in the url construction.
 
= VersionWhat next? Control =
 
That is left as an exercise for you :), maybe include this in an AJAX enabled 'Conditions now' page - similar to the supplied Cumulus index.htm? This is what [http://weather.wilmslowastro.com/index.htm I have done here].
* 1.0 - 29 Nov 2012 - First release [[http://wiki.sandaysoft.com/files/Realtime_Highcharts_v1-0.zip Download]]
 
= Version Control =
 
* 1.0 - 29 Nov 2012 - First release [[http://wiki.sandaysoft.com/files/Realtime_Highcharts_v1-0.zip Download]]

Navigation menu