Template:Climate/doc

This template allows a collection of climate information to be placed on a page in a box that floats to the right. Bar charts for temperature, rainfall, and snowfall are supported, as well as totals and other data including total rainfall; maximum, minimum, and average temperature; and total snow days. The default units for temperature are degrees Farenheit and the default units for rain and snow are inches, but the template allows other units to be specified. If the defaults are used, the template automatically converts the data to metric units and displays both values.

Usage
For backward compatibility, the following fields will still work:
 * boxwidth : The overall width of the climate stats box. This may be specified in any accepted CSS units (cm, mm, in, px, em, and so on). You may specify a percentage, but the CSS "width" parameter does not include borders, margins, or padding, so 90% is about the largest you can use and still have it all fit on a typical wiki page. If unspecified, the box will be the minimum width needed to render all the data, but this often results in an uneven presentation. It is recommended that you set this big enough to make the graphs and surrounding text pleasantly readable.
 * float : Default is "right". By default, the box will float to the right and allow text to flow along its left side. You may also choose "left" or "center" with this parameter.
 * clear : Default is "both". This floating element will stack vertically with other elements, but if you want it to snuggle up with other elements that will fit side-by-side, you can set this to "none". Other values allowed include "left" and "right" for selective stacking.
 * title : The main title across the top of the box. If unspecified, it will display as "Climate for " You may add a &lt;ref&gt; tag to this field.
 * climaterefs : You may put &lt;ref&gt; tags for the entire box here. This will render as a superscript link on the main title.
 * tempsubtitle, rainsubtitle, snowsubtitle : Subtitles for each of the bar graphs. If unspecified, these default to "Average Temperature", "Average Rainfall", and "Average Showfall".
 * temprefs, rainrefs, snowrefs : You may add &lt;ref&gt; tags to the subtitles as well.
 * temp1-12 : Up to twelve temperature values may be specified. Units default to ℉ and will also be converted to ℃.
 * tempunits : Use this to specify your own units for temperature.
 * templabel1-12 : The labels for the temperature bars. These default to the months of the year according to the Calendar of Harptos. If you don't use all 12 bars, then you probably want to set the corresponding labels.
 * maxtemp : Default is 150. This determines the value represented by the top of the bar. Set this higher than your highest temperature because the numbers are put inside the box and will break through the top if there is not enough room.
 * mintemp : Default is 0. This determines the value represented by the bottom of the bar. Negative numbers are allowed, and are recommended if you specify showzero (may depend on the scale used).
 * showzero : Setting this to any value (typically yes) will add a horizontal line to the temperature chart indicating the freezing point of water. It will look bad if you don't set mintemp low enough for this line to intersect the bars. Don't turn this on if you are using a non-default tempunits.
 * tempscale : Default is 1.0. If the range is too small (or too large) to make a readable graph, you can scale the whole range by specifying a scale factor here.
 * tempwidth : Default is 30 (pixels). If a data value renders too wide to fit inside a bar, you can increase the width of all temperature bars by adding a value in pixels here. Do not add the "px", just specify a number.
 * rain1-12, snow1-12 : Similar to temp except for rainfall and snowfall. Units default to inches and will also be converted to millimeters for rain and centimeters for snow.
 * rainunits, snowunits : Similar to tempunits.
 * rainlabel1-12, snowlabel1-12 : Similar to templabel.
 * maxrain, maxsnow : Similar to maxtemp.
 * minrain, minsnow : Similar to mintemp.
 * rainscale, snowscale : Similar to tempscale.
 * rainwidth, snowwidth : Similar to tempwidth.
 * totalrain : If set, the total rainfall for the graph will be displayed at the bottom of the box. If not specified but rain1 has a value, this field will be the sum of the twelve rain values. Conversion to metric units will be added if rainunits is not specified.
 * chartperiod : The default label for total rainfall is "Annual precipitation" but you can override the word "Annual" with this field as appropriate period of the graph.
 * hightemp : The highest temperature for this climate. Conversion to metric units will be added if tempunits is not specified.
 * lowtemp : The lowest temperature for this climate. Conversion to metric units will be added if tempunits is not specified.
 * averagetemp: The average temperature for this climate. Conversion to metric units will be added if tempunits is not specified.
 * snowdays : The typical or average number of days that snow remains on the ground for this climate.
 * source : If you don't want to put a &lt;ref&gt; tag on one of the headings, you may link to the source of the climate data with this field. It will be set off from the rest of the box by a horizontal line. Don't forget to italicize the name of the book.
 * page : The page number of the reference for the climate data.
 * nocat : The page the calls this template will be placed in Category:Articles with climate statistics. To suppress this category, set this to "true". This parameter is typically only used on documentation pages like this one.
 * label1-12 : Labels for the 12 boxes of all three graphs.
 * scale : The scale factor for the temperature graph only.

Examples
The best way to see how this works is by example. Here is a simple temperature chart for average temperatures throughout the Faerûnian year, with a line showing the freezing point.

Which renders as:

Note that in this example, the month names are filled in automatically, but the upper limit is too great, leaving a big gap between the highest bar and the top of the empty bar. The lower limit defaults to 0&thinsp;℉ which is lower than we really need. Setting maxtemp to 130 shrinks the gap on top and setting mintemp to 20 reduces the height of the bars even further:

Which looks like:

By default, the title of the climate chart area will say "Climate for article", where 'article' is the name of the article. If you want to change this, you can do so with the title parameter.

Which gives us:

You can specify a source for the data in either of two ways. Please pick one or the other and not both, as shown here:

If you do not want a chart of the twelve months, you can specify your own periods. If you do this, you must specify labels, otherwise the default month names will be used, and will be inappropriate.

It is possible to change the units displayed on the charts by using the tempunits parameter. This does have the unfortunate effect of making the bars quite small, but there are workarounds in the following examples.

By default, one degree of temperature or unit of rainfall equals one pixel in height on the bar chart. If you wish to increase (or for some reason, decrease) this ratio, you may specify a scale factor. Here is the previous example scaled up by setting tempscale to 2.5:

If you need to use negative values (for temperature, for example) you can specify a minimum value (mintemp) as well as a maximum. You are not required to specify a maximum if you specify a minimum&mdash;if one is not provided, the default will be used. A side effect of this is that you can make the bars longer by supplying a lower minimum. We scale by a factor of 2.5 again, for comparison with the previous example.

You can specify rainfall in a similar way you specify temperature, using maxrain, rainunits, and rain1, rain2, etc. The key difference here is that you cannot specify negative numbers for rainfall, because this is nonsensical. The other difference is that annual precipitation is calculated automatically. Note the default unit of measurement is inches. This may not produce bars of significant height, but you can scale them up to a reasonable height with rainscale.

Note that the metric units word-wrap to the next line, messing up the presentation. To fix this, we make the bars a little bit wider by increasing rainwidth from the default (30px) to 40px. While we're at it, let's adjust maxrain and rainscale as well.

If desired, you can specify a custom total rainfall to display on the chart with totalrain. The main use for this is to specify annual precipitation without showing the rainfall bars on the chart.

If your chart does not represent an annual period, you can change this label on precipitation using chartperiod. In this example, we are creating a rainfall chart that runs for 4 months of the year.

For your chart period, you can optionally specify highest, lowest and average temperatures as well as the number of days that snow covers the ground, using hightemp, lowtemp, averagetemp, and snowdays respectively. This is independent of the need to have a temperature chart on the climate area. In fact, you need not have any charts at all, if so desired.

This is a complete example, demonstrating all the features of the template. You will probably not need to use all the features at once like this. Here is the template call: