Highcharts - Realtime: Difference between revisions

From Cumulus Wiki
Jump to navigationJump to search
no edit summary
No edit summary
No edit summary
*PHP
*Cumulus Realtime.txt
 
<br>
 
= Installation =
 
*Download and copy the [http://www.highcharts.com/ Highcharts] files on to your web server
*Download the [http://unxutils.sourceforge.net/ GNU utilities for Win32]&nbsp;- I used the&nbsp;latest updates (after 14-04-03)&nbsp;
*Download the [http://wiki.sandaysoft.com/files/Realtime_Highcharts_v0Realtime_Highcharts_v1-10.zip Realtime_Highcharts ZIP file] &nbsp;(right click, Save as)
 
Next you have to decide where and how the realtime log file will be created. The zip file contains a simple Windows batch file that will create a log file of a specified length. If you have a Windows web server you could run it directly on there (this is how I do it), or run it on your Cumulus computer and get Cumulus to upload the log file periodically.
 
Wherever you run the batch file to create the realtime log, you will also need a copy the 'tail.exe' utility from the GNU utilities for Win32 zip file.
 
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, and the realtimeLogParser.php script I have written returns all the entries it finds in the file. It would require amendment to work with the larger TNET logs.
 
= The result =
 
You should end up with a default graph looking something like this
[[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.
 
= Version Control =
Next you have to decide where and how the realtime log file will be created. The zip file contains a simple Windows batch file that will create a log file of a specified length. If you have a Windows web server you could run it directly on there (this is how I do it), or run it on your Cumulus computer and get Cumulus to upload the log file periodically.
 
* 1.0 - 29 Nov 2012 - First release [[http://wiki.sandaysoft.com/files/Realtime_Highcharts_v1-0.zip Download]]
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, and the realtimeLogParser.php script I have written returns all the entries it finds in the file. It would require amendment to work with the larger TNET logs.

Navigation menu