Шаблон:Graph:Lines/doc
This graph's main version resides at Template:Graph:Lines. Please make or suggest all the changes there, and copy it everywhere else (until the copying is automated)
{{Graph:Lines | table=bls.gov/US Women's weekly earnings as a percent of men's by age, annual averages.tab |
{{Graph:Lines | 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 |
---|---|
См исходные данные. |
Данные из запроса в Викиданные. |
Wikidata query produces three columns - year, population size, and country name. This graph shows one line per country. {{Graph:Lines #Population of countries sharing a border with Germany SELECT ?year ?population ?countryLabel WHERE { { SELECT ?country ?year (AVG(?population) AS ?population) WHERE { { SELECT ?country (YEAR(?date) AS ?year) ?population WHERE { ?country wdt:P47 wd:Q183. ?country p:P1082 ?populationStatement. ?populationStatement ps:P1082 ?population. ?populationStatement pq:P585 ?date. } } } GROUP BY ?country ?year } SERVICE wikibase:label { bd:serviceParam wikibase:language "en". } } | type=year | xField=year | group=countryLabel | value=population | |
Данные из запроса в Викиданные. |
This graph draws one or more independent numeric data series as lines. The data must be stored on Commons' Data namespace or come from Wikidata Query Service.
Параметр | Описание | Тип | Статус | |
---|---|---|---|---|
tabletype | 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.
| Строковый (без форматирования) | необязательный |
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 | Строковый (без форматирования) | обязательный |
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)
| Строковый (без форматирования) | предложенный |
xField | xField | Id of the data column that contains values for the X axis. If type=year, xField is also "year" by default. | Строковый (без форматирования) | обязательный |
series | series | If each line 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". | Строковый (без форматирования) | необязательный |
group | group | If line color depends on just one column, specify that column's ID, instead of the series parameter. | Строковый (без форматирования) | необязательный |
value | value | If line color depends on one column, this parameter should be set to the column which has the values | Строковый (без форматирования) | необязательный |
xZero | xZero | Force to start or not to start X axis with zero. Can be either true or false | Строковый (без форматирования) | необязательный |
yZero | yZero | Force to start or not to start Y axis with zero. Can be either true or false | Строковый (без форматирования) | необязательный |
xMin | xMin | Force X axis to start from this value | Неизвестно | необязательный |
xMax | xMax | Force X axis to end with this value | Неизвестно | необязательный |
yMin | yMin | Force Y axis to start from this value | Неизвестно | необязательный |
yMax | yMax | Force Y axis to end with this value | Неизвестно | необязательный |
xAxis | xAxis | Title of the X axis | Строковый (без форматирования) | необязательный |
yAxis | yAxis | Title of the Y axis | Строковый (без форматирования) | необязательный |
xGrid | xGrid | Show grid lines for X axis | Логическое значение | необязательный |
yGrid | yGrid | Show grid lines for Y axis | Логическое значение | необязательный |
xTicks | xTicks | How many ticks to show on X axis. 7 by default. '-' value makes it automatic. | Число | необязательный |
yTicks | yTicks | How many ticks to show on Y axis. Auto by default. | Число | необязательный |
title | title | Title of the whole graph | Строковый (без форматирования) | необязательный |
legend | legend | Title of the legend | Строковый (без форматирования) | необязательный |
Color palette | colors | The colors of the areas or bars, specified as Vega defined rangeliteral. This can also be a list like [ "red", "green" ]
| Строковый (без форматирования) | необязательный |
width | width | без описания | Число | необязательный |
height | height | без описания | Число | необязательный |
debug | debug | if set, will show graph as raw JSON | Строковый (без форматирования) | необязательный |