Template:Graph:Stacked/doc
![]() | This is a documentation subpage for Template:Graph:Stacked. It contains usage information, categories and other content that is not part of the original template page. |
This graph's main version resides at Template:Graph:Stacked. Please make or suggest all the changes there, and copy it everywhere else (until the copying is automated)
{{Graph:Stacked | table=Bea.gov/GDP by state.tab |
{{Graph:Stacked | table=Bea.gov/GDP by state.tab |
---|---|
![]() See or edit source data. |
![]() See or edit source data. |
{{Graph:Stacked | tabletype=query | table= SELECT ?decade (COUNT(?decade) AS ?count) WHERE { ?item wdt:P31 wd:Q3305213 . ?item wdt:P571 ?inception . BIND( year(?inception) as ?year ). BIND( ROUND(?year/10)*10 as ?decade ) . FILTER( ?year > 1400) } GROUP BY ?decade ORDER BY ?decade | series="count" | type=year | xField=decade |
{{Graph:Stacked | tabletype=query | table= SELECT ?year (COUNT(?_genre) AS ?count ) (SAMPLE(?_genreLabel) AS ?label ) WHERE { ?item wdt:P31 wd:Q11424. ?item wdt:P577 ?_publication_date. ?item wdt:P136 ?_genre. ?_genre rdfs:label ?_genreLabel. BIND(str(YEAR(?_publication_date)) AS ?year) FILTER((LANG(?_genreLabel)) = "en") FILTER (?_publication_date >= "2000-00-00T00:00:00Z"^^xsd:dateTime) } GROUP BY ?_genreLabel ?year HAVING (?count > 30) | type=year | xField=year | group=label | value=count | legend=- |
![]() See source Wikidata query.. |
![]() See source Wikidata query.. |
This graph draws one or more independent numeric data series as either bar or area slices, stacked one on top of the other. The data must be stored on Commons' Data namespace or come from Wikidata Query Service.
Parameter | Description | Type | Status | |
---|---|---|---|---|
Table type | tabletype | Specifies the type of the table data. "tab" (default) uses data namespace on commons, without the data: prefix. "query" sends request to wikidata query service.
| String | optional |
Table | table | Data page name on Commons, without the Data: prefix. The table should contain xField column, like year or date, and one or more series columns to plot. If tabletype parameter is set to "query", this value is the query | String | required |
X axis type | type | Type of the x axis - time (e.g. "2015-10" or "2013-03-08), year (integer, but treated as a year), linear (numbers), ordinal (anything)
| String | suggested |
X field | xField | Id of the data column that contains values for the X axis. If type=year, xField is also "year" by default. | String | required |
Series | series | If each slice is represented by a separate column of data (or if there is only one column), list of the data columns to show as lines. Must be in quotes, and listed by field IDs if coming from a .tab page: "field1", "field2", "field3". | String | optional |
Group | group | If slice color depends on just one column, specify that column's ID, instead of the series parameter. | String | optional |
Value | value | If slice color depends on one column, this parameter should be set to the column which has the values | String | optional |
Bar width | barwidth | If set, show graph with bars instead of areas. If set, must be either an integer pixel width of the bars, or when type=ordinal, can also be set to 'auto' | String | optional |
X axis starts at 0 | xZero | Force to start or not to start X axis with zero. Can be either true or false | String | optional |
Y axis zero starts at 0 | yZero | Force to start or not to start Y axis with zero. Can be either true or false | String | optional |
X axis minimum | xMin | Force X axis to start from this value | Unknown | optional |
X axis maximum | xMax | Force X axis to end with this value | Unknown | optional |
Y axis minimum | yMin | Force Y axis to start from this value | Unknown | optional |
Y axis maximum | yMax | Force Y axis to end with this value | Unknown | optional |
Title | title | Title of the whole graph | String | optional |
X axis title | xAxis | Title of the X axis | String | optional |
Y axis title | yAxis | Title of the Y axis | String | optional |
X axis grid | xGrid | Show grid lines for X axis | Boolean | optional |
Y axis grid | yGrid | Show grid lines for Y axis | Boolean | optional |
X axis ticks | xTicks | How many ticks to show on X axis. 7 by default. '-' value makes it automatic. | Number | optional |
Y axis ticks | yTicks | How many ticks to show on Y axis. Auto '-' by default. | Number | optional |
Legend | legend | Title of the legend | String | optional |
Width | width | no description | Number | optional |
height | height | no description | Number | optional |
Colors | colors | The colors of the areas or bars, specified as Vega defined rangeliteral. This can also be a list like [ "red", "green" ]
| String | optional |
Debug | debug | if set, will show graph as raw JSON | String | optional |
Edit parameter translations