Edge Rewrite
// HTMLRewriter · presentation

This page was redesigned at the edge.

Cloudflare fetched the original article and streamed it through HTMLRewriter to apply an entirely new visual system without rebuilding the source page.

// request.cf · coarse context

A page that knows where it met you.

Only coarse request metadata is shown. This demo does not display or persist visitor IP addresses.

Country
US
Cloudflare location
CMH
Connection
HTTP/2
Language
Not provided

Ray ID: a226cb72ed401dfc

Jump to content

Template:ChartDirectPop/doc

From Wikipedia, the free encyclopedia

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
}}
PopulationYear5010015020025030035019801990200020102020ChartDirectPop/doc

simple population plot with wikidata

[edit]
{{ChartDirectPop
|pageIds=Q84
}}
PopulationYear02,000,0004,000,0006,000,0008,000,00010,000,000180018501900195020002050London
{{ChartDirectPop
|pageIds=Q90
}}
PopulationYear2,100,0002,130,0002,160,0002,190,0002,220,0002,250,00019901995200020052010201520202025Paris
{{ChartDirectPop
|thumb
|pageIds=Q90
|xEnd=2014
}}
PopulationYear2,120,0002,140,0002,160,0002,180,0002,200,0002,220,0002,240,0002,260,000199019952000200520102015Paris

simple bar population plot

[edit]
{{ChartDirectPop
|x=1980,1990,2000,2010,2020
|y1=98,87,201,252,325
|type=bar
}}
PopulationYear05010015020025030035019801990200020102020ChartDirectPop/doc

full width

[edit]
{{ChartDirectPop
| width      = 100%
|x=1980,1990,2000,2010,2020
|y1=98,87,201,252,325
|y1Title=Population
}}
PopulationYear5010015020025030035019801990200020102020Population

aligned and fixed width

[edit]
{{ChartDirectPop
| align      = right
| width      = 400px
|x=1980,1990,2000,2010,2020
|y1=98,87,201,252,325
|y1Title=Population
}}
PopulationYear5010015020025030035019801990200020102020Population

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
}}
PopulationYear5010015020025030035019801990200020102020Population

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
}}
PopulationYear5010015020025030035019801990200020102020Population
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
}}
PopulationYear10,00010,50011,00011,50012,00012,5001/15/19801/15/1981Population
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]

see Template:ChartDirect#Troubleshooting

TemplateData

[edit]

Includes a chart with source attribution and allows adjusting alignment, width, and border.

Template parameters

ParameterDescriptionTypeStatus
xx

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.

Linesuggested
y1y1 y

Values first row y-Axis. Further parameters y2-y15 are supported

Example
520,621,433
Numbersuggested
y1Titley1Title yTitle

Legend value y-Axis. It is necessary for each y-Axis row (e.g. y1 and y1Title). Additional parameters y2-y15 are supported

Example
population of Exampleville
Lineoptional
xTypexType

Data format of the x-Axis

Suggested values
number integer date string
Lineoptional
Use of predefined template chartstype

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.

Suggested values
bar line
Default
line
Lineoptional
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%
Default
600px
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
Source attributionsource

Option to cite a source

Example
some reference
Lineoptional
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
pageIdspageIds

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.

Example
Q84
Lineoptional
xEndxEnd

Wikidata: last year of plot.

Example
2015
Numberoptional
precisionprecision

Wikidata: Option to Filter only for certain dates with Wikidata plots. See Template:WikidataChart for documentation of this parameter.

Example
9
Numberoptional

See also

[edit]