Template:Graph:Chart/doc

Basic examples
Line Chart:

Note: The y-axis starts from the smallest y value, though this can be overridden with the  parameter.

Area chart:

Note: The y-axis starts from zero

Bar chart:

Multiple data series
Line chart with more than one data series, using colors:

Area chart with more than one data series showing blended overlap:

Bar chart with multiple data series:

Area chart with smoothed data values:

Bar chart with stacked data series:

Scatter plot
By using a line plot with, it is possible to create a scatter plot:

Using percentages

 * When  or   is set to , a percentage sign will be added to the scale of the corresponding axis.
 * A value of  equals 100%. A decimal point should be added in front of percentages between 0 and 100, for instance   for 25%.
 * Including the code  will force the y axis scale to run from 0% to 100%.

A graph showing values greater than 100% and negative values:

Display
Line chart in an image frame:

Bar chart in a side box:

Legends
A legend can be added where there are multiple data series:

The title can be omitted by leaving the parameter blank:

Long legend entries can look clumsy. It may be better to omit the legend parameter and use Legend (or a similar template) instead:

{{legend|darkred|This is a long legend entry and wouldn't look so good if it was part of the graph itself.}} {{legend|gold|This is another fairly long entry.}} {{legend|darkred|This is a long legend entry and wouldn't look so good if it was part of the graph itself.}} {{legend|gold|This is another fairly long entry.}}

This method also allows the use of wiki formatting and the insertion of links. Graphs using the default colors need to specify the hex values in the legend templates: • {{legend|#1f77b4|#1f77b4}}

• {{legend|#ff7f0e|#ff7f0e}}

• {{legend|#2ca02c|#2ca02c}}

• {{legend|#d62728|#d62728}}

• {{legend|#9467bd|#9467bd}}

• {{legend|#8c564b|#8c564b}}

• {{legend|#e377c2|#e377c2}}

• {{legend|#7f7f7f|#7f7f7f}}

• {{legend|#bcbd22|#bcbd22}}

• {{legend|#17becf|#17becf}}

Alternatively, CSS color names (or hex values) can be specified in the graph and the legend templates.