AnnualDataSummary: Difference between revisions

From Cumulus Wiki
Jump to navigationJump to search
m
mNo edit summary
 
*variable '''mn''' is a list of the 12 months of the year, in an abbreviated format. You may change these as necessary, but try to keep it to an abbreviation as there is limited space.
*''''label_items'''' is a list of all possible data sets to be displayed. Again you can change these to suit ''if you are prepared to wade through all the script and make changes elsewhere too''. However, the format is a little more involved and you should take some care. Each row represents one data set, with 4 columns of settings for that data set; so the default list is an array of four by six.
 
Example of a row,....
*Finally, 'true' will display this button at the top; 'false' will hide it. Therefore, if you do not wish to allow users to jump to the 'Rainfall data set' change the 'true' to 'false' in the 'rainfall' element of the variable. (true/false MUST be lowercase)
 
(<span style="color: red">NOTE: [[User:Sfws|Sfws]] 12:22, 31 December 2012 (UTC)</span>
 
The ''switch'' part of the coding identifies the columns in dayfile.txt for the values to be displayed. If you wish to add new data sets then see the alternative JavaScript version in the forum for more explanation about the original coding, and an alternative way to specify the columns in a revised version of the above array.)
<span style="color: red">Having made any change to the array as DAJ says above, you also need to change what is in a '''switch''' section below where DAJ says '// Nothing to edit below here'.</span>
<br>
 
<span style="color: red">The ''switch ($whatdata) { ... }'' part of the coding identifies the columns in dayfile.txt for the values to be displayed. Any change you make in the array, needs a corresponding change within this part of the script. A typical case here reads</span>
 
"case 'mintemp' : $tablelayout .= $label_items[1][2]; $dayfilecol=4; break;",
 
<span style="color: red">so to add a new one, copy that line and paste it in again but in this new line replace 'mintemp' with whatever you have added as the first element in your new array row, replace '[1]' with square brackets round the number of your new array row (the first row is number zero) and finally replace '4' with the [[Dayfile.txt#List_of_fields_in_the_file|field number]] where the parameter you have added is found in dayfile.txt.</span>
 
The<span ''switch''style="color: partred">It ofreally theis coding identifies the columns in dayfile.txt for the values to be displayed. If youmuch wisheasier to add new data sets thenif seeyou use the alternative JavaScript version in the forum. forThat includes more explanation about the original coding, and an alternative simpler way to specify and adjust the columns in a revised version of the above array.)</span>
 
== Styling (applies only to original version of code) ==
5,838

edits

Navigation menu