Jump to content

Template:Graph:Population history/doc

From mediawiki.org

This graph's main version resides at mediawiki Template:Graph:Population_history. Please make all the changes there and copy it everywhere else (until the copying is automated)

{{Graph:Population history|Q84}}
Show London's population history from Wikidata
{{Graph:Population history

| table=Wikidata/St.Petersburg.tab
| atable=Original/St.Petersburg population annotations.tab}}
Show population of St.Petersburg from the table on Commons, with annotations

Inserts a graph with the population history for the given city.

Template parameters

This template prefers block formatting of parameters.

ParameterDescriptionTypeStatus
City Wikidata ID1

Wikidata ID of the city or region

Default
Q84
Stringoptional
Title of the data page on Commonstable

Data page name on Commons, without the Data: prefix. The table must contain "year" and "population" columns.

Stringoptional
Raw values for this graphvalues

Supply all values as a list of JSON objects: {"year":1980, "population":1000}, {"year":1984, "population":1045}, ...

Unknownoptional
Title of the annotations data page on Commonsatable

Data page name on Commons, without the Data: prefix. The table must contain "year" column, and optional "text" and "color" columns.

Stringoptional
Raw annotation valuesavalues

Supply all annotation values as a list of JSON objects: {"year":1980, "text":"Big event"}, ...

Unknownoptional
Filter expressionfilter

Optionally, filter the data with an expression, e.g. datum.year >= 1900 && datum.year < 2000

Unknownoptional
Graph colorcolor

Shade with which to highlight the data in the chart

Default
#00f
Example
#f00
Stringoptional
Interpolateinterpolate

How data points should be connected, e.g. linear, step-before, step-after, basis, basis-open, cardinal, cardinal-open, monotone

Default
monotone
Example
linear
Stringoptional
Graph scalescale

Scaling could be one of these: linear, log, pow, sqrt, quantile, quantize, and threshold

Default
linear
Example
log
Stringoptional
Maximum Y value axismax

This optional value might be useful to align multiple graphs side-by-side

Default
Automatically scaled to the data.
Example
10000
Numberoptional
Widthwidth

Width for the chart in pixels, if different from the default.

Default
400
Numberoptional
Heightheight

Height for the chart in pixels, if different from the default.

Default
200
Numberoptional