AnnualDataSummary: Difference between revisions

no edit summary
No edit summary
No 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>
<spanThe style="color:''switch'' red">Itpart reallyof isthe muchcoding identifies the columns in dayfile.txt for the values to be displayed. If you easierwish to add new data sets ifthen you usesee the alternative JavaScript version in the forum. That includesfor 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>)
 
<br>
<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>
 
<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>
 
<span style="color: red">It really is much easier to add new data sets if you use the alternative JavaScript version in the forum. That 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