Template:ChartDirectPop
Appearance
This template allows to generate simple population plots using the Chart Feature. It is based on the transform functionality and uses the Template:ChartDirect and the commons module c:Module:Graph:Chart.
Copy templates
[edit]
With default templates
{{ChartDirectPop
| type =
| x= | y1= | y1Title=
| thumb =
| align =
| width =
| border =
| style =
| caption =
| source =
}}
or With own template
{{ChartDirectPop
| chart =
| x= | y1= | y1Title=
| thumb =
| align =
| width =
| border =
| style =
| caption =
| source =
}}
or With Wikidata
{{ChartDirectPop
| chart =
| pageIds =
| thumb =
| align =
| width =
| border =
| style =
| caption =
| source =
}}
Examples
[edit]simple population plot
[edit]{{ChartDirectPop
|x=1980,1990,2000,2010,2020
|y1=98,87,201,252,325
}}
View chart definition.
simple population plot with wikidata
[edit]{{ChartDirectPop
|pageIds=Q84
}}
View chart definition.
{{ChartDirectPop
|pageIds=Q90
}}
View chart definition.
{{ChartDirectPop
|thumb
|pageIds=Q90
|xEnd=2014
}}
View chart definition.
simple bar population plot
[edit]{{ChartDirectPop
|x=1980,1990,2000,2010,2020
|y1=98,87,201,252,325
|type=bar
}}
View chart definition.
full width
[edit]{{ChartDirectPop
| width = 100%
|x=1980,1990,2000,2010,2020
|y1=98,87,201,252,325
|y1Title=Population
}}
View chart definition.
aligned and fixed width
[edit]{{ChartDirectPop
| align = right
| width = 400px
|x=1980,1990,2000,2010,2020
|y1=98,87,201,252,325
|y1Title=Population
}}
View chart definition.
aligned and fixed width thumbnail
[edit]{{ChartDirectPop
| thumb
| align = left
| width = 400px
|x=1980,1990,2000,2010,2020
|y1=98,87,201,252,325
|y1Title=Population
}}
View chart definition.
centered, fixed width, border, caption and source
[edit]{{ChartDirectPop
| chart = Template line population by year.chart
| x=1980,1990,2000,2010,2020
| y1=98,87,201,252,325
| y1Title=Population
| align = center
| width = 400px
| caption = Population of Exampleville
| source = per reference xyz
}}
Population of Exampleville Source: per reference xyz
date format shown
[edit]Note: dates are not yet fully supported by the chart extension, but they will be converted to local time format when display.
{{ChartDirectPop
| type = line
| x=1980-01-15,1980-07-15,1981-01-15,1981-07-15
| y1=10142,10796,11285,12409
| y1Title=Population
| xType = date
| width = 800px
| caption = Population of AnotherExampleVille
}}
Population of AnotherExampleVille View chart definition.
Further information
[edit]Create own templates
[edit]By using the parameter chart an own chart can be selected as template. See more information at Template:ChartDirect#Create own templates
Troubleshooting
[edit]TemplateData
[edit]Includes a chart with source attribution and allows adjusting alignment, width, and border.
| Parameter | Description | Type | Status | |
|---|---|---|---|---|
| x | x | Values x-Axis. Note: if a-Axis is not set, the template will try to create a wikidata chart based on the linked Wikidata-Item if the PageIds parameter is also not set. | Line | suggested |
| y1 | y1 y | Values first row y-Axis. Further parameters y2-y15 are supported
| Number | suggested |
| y1Title | y1Title yTitle | Legend value y-Axis. It is necessary for each y-Axis row (e.g. y1 and y1Title). Additional parameters y2-y15 are supported
| Line | optional |
| xType | xType | Data format of the x-Axis
| Line | optional |
| Use of predefined template charts | type | Data:...chart on Wikimedia Commons. Predefined charts based on the selected plot type. If parameter <code>chart</code> or <code>definition</code> is set, this parameter will be ignored.
| Line | optional |
| Display as thumbnail | thumb 1 | Set to any value to display in a gray box like an image thumbnail
| Line | optional |
| Alignment | align 2 | Chart alignment, either "left", "right", or "center"
| Line | optional |
| Width | width 3 | Width in pixels or percent
| Line | optional |
| Caption | caption 4 | Caption to display before the source information. Make sure to use ending punctuation.
| String | optional |
| Chart definition | chart definition | Chart on Wikimedia Commons, without the "Data:" prefix
| Line | required |
| Source attribution | source | Option to cite a source
| Line | optional |
| Border | border | Set to "1" to enable a border
| Boolean | optional |
| CSS styles | style | Additional CSS styles (beyond width and border)
| Line | optional |
| Hide source | hideSource | Set to any value to disable linking to the source
| Boolean | optional |
| pageIds | pageIds | Wikidata: Page Ids of wikidata pages to plot. If a wikidata chart is created and this parameter is not set, then it will automatically use the linked wikidata item. Be aware of limitations when plotting several wikidata items that may cause wrong plots.
| Line | optional |
| xEnd | xEnd | Wikidata: last year of plot.
| Number | optional |
| precision | precision | Wikidata: Option to Filter only for certain dates with Wikidata plots. See Template:WikidataChart for documentation of this parameter.
| Number | optional |