Template:Chart

☆ Save On Wikipedia ↗
Template documentation

Usage

This template implements Wikipedia's #chart extension in a user-friendly manner. In articles and most other places, it should always be used instead of #chart, so that editors are provided with a link (under the chart) to the source data, in case they need to edit it.

Copy templates

Standard

{{Chart|chart=.chart}}

Full

{{Chart
| chart      = 
| data       = 
| thumb      =
| align      = 
| width      = 
| border     = 
| style      = 
| caption    =
| source     = 
}}

or

{{Chart|thumb|align|width|caption|chart=.chart|data=.tab|border=|style=|source=.tab}}

Examples

full width

{{Chart
| chart = Autobahn network length.Line.chart
}}
Length in kilometresYear03K6K9K12K15K1932195019851999200620132020ReichsautobahnBundesautobahn (West Germany)Bundesautobahn (Germany)Development of the length of the Reichsautob...

other data source and border

{{Chart
| chart      = Monthly stream discharges.chart
| data       = GRDC-1530100 monthly discharge.tab
| border     = 1
}}
Discharge in m³/sMonth0100200300400500JanMarMayJulSepNovMinMeanMaxHydrograph: Monthly discharge

thumbnail, caption, and source

{{Chart
| thumb
| caption = Autobahn network length.
| source  = Autobahn network length.tab
| chart   = Autobahn network length.Line.chart
}}
Length in kilometresYear03K6K9K12K15K1932195019851999200620132020ReichsautobahnBundesautobahn (West Germany)Bundesautobahn (Germany)Development of the length of the Reichsautob...
Autobahn network length. View source data.

aligned and fixed width

{{Chart
| chart      = Autobahn network length.Line.chart
| align      = right
| width      = 400px
}}
Length in kilometresYear03K6K9K12K15K1932195019851999200620132020ReichsautobahnBundesautobahn (West Germany)Bundesautobahn (Germany)Development of the length of the Reichsautob...

aligned and fixed width thumbnail

{{Chart
| thumb
| chart      = Autobahn network length.Line.chart
| align      = left
| width      = 400px
}}
Length in kilometresYear03K6K9K12K15K1932195019851999200620132020ReichsautobahnBundesautobahn (West Germany)Bundesautobahn (Germany)Development of the length of the Reichsautob...

centered, fixed width, border, caption and source

{{Chart
| chart      = Autobahn network length.Line.chart
| align      = center
| width      = 400px
| caption    = Autobahn network length.
| source     = Autobahn network length.tab
}}
Length in kilometresYear03K6K9K12K15K1932195019851999200620132020ReichsautobahnBundesautobahn (West Germany)Bundesautobahn (Germany)Development of the length of the Reichsautob...
Autobahn network length. View source data.

TemplateData

This is the TemplateData for this template used by TemplateWizard, VisualEditor and other tools. See a monthly parameter usage report for Template:Chart in articles based on its TemplateData.

TemplateData for Chart

Includes a chart ([[Help:Charts]]) with source attribution and allows adjusting alignment, width, and border.

Template parameters

ParameterDescriptionTypeStatus
Display as thumbnailthumb 1

Set to any value to display in a gray box like an image thumbnail

Suggested values
thumb
Example
thumb
Lineoptional
Alignmentalign 2

Chart alignment, either "left", "right", or "center"

Suggested values
left right center
Lineoptional
Widthwidth 3

Width in pixels or percent

Suggested values
400px 600px 50% 100%
Lineoptional
Captioncaption 4

Caption to display before the source information. Make sure to use ending punctuation.

Example
This is a chart caption.
Stringoptional
Chart definitionchart definition

Chart on Wikimedia Commons, without the "Data:" prefix

Example
Example.chart
Linerequired
Chart datadata

.tab on Wikimedia Commons, without the "Data:" prefix (overrides the specification in the chart definition)

Example
Example.tab
Linesuggested
Source attributionsource

Source .tab file to be linked at the bottom, without the "Data:" prefix. If not specified, it will fallback to displaying the value of "data" or "chart".

Example
Example.tab
Linesuggested
Borderborder

Set to "1" to enable a border

Suggested values
1
Example
1
Booleanoptional
CSS stylesstyle

Additional CSS styles (beyond width and border)

Example
border-width:5px;
Lineoptional
Hide sourcehideSource

Set to any value to disable linking to the source

Suggested values
1
Example
1
Booleanoptional

Tracking categories

See also