Data:Templatedata/Graph:Stacked.tab

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.

namelabeltyperequiredsuggesteddefaultdescription
stringlocalizedstringbooleanbooleanstringlocalized
namelabeltyperequiredsuggesteddefaultdescription
tabletypeTable type(3)stringtabSpecifies the type of the table data. "tab" (default) uses data namespace on commons, without the data: prefix. "query" sends request to wikidata query service.(2)
tableTable(2)stringData 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(2)
typeX axis type(2)stringyearType of the x axis - time (e.g. "2015-10" or "2013-03-08), year (integer, but treated as a year), linear (numbers), ordinal (anything)(2)
xFieldX field(2)stringId of the data column that contains values for the X axis. If type=year, xField is also "year" by default.(2)
seriesSeries(2)stringIf 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".(2)
groupGroup(2)stringIf slice color depends on just one column, specify that column's ID, instead of the series parameter.(2)
valueValue(2)stringIf slice color depends on one column, this parameter should be set to the column which has the values(2)
filterFilter(1)stringOptionally filter data with an template expression parameter e.g. `filter = datum.some_dataset_field > 1900 && datum.some_dataset_field < 2000` where `some_dataset_field` means some valid field of displayed dataset(1)
barwidthBar width(2)stringIf 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'(2)
xZero, xAxisZeroX axis starts at 0(2)stringForce to start or not to start X axis with zero. Can be either true or false(2)
yZero, yAxisZeroY axis zero starts at 0(2)stringForce to start or not to start Y axis with zero. Can be either true or false(2)
xAxisClampX axis scale clamp(1)boolean
yAxisClampY axis scale clamp(1)boolean
xMin, xAxisMinX axis minimum(2)Force X axis to start from this value(2)
xMax, xAxisMaxX axis maximum(2)Force X axis to end with this value(2)
yMin, yAxisMinY axis minimum(2)Force Y axis to start from this value(2)
yMax, yAxisMinY axis maximum(2)Force Y axis to end with this value(2)
titleTitle(2)stringTitle of the whole graph(2)
titleXAlignTitle horizontal alignment(1)stringHorizontal alignment of title, could be one of: left, center, right(1)
titleXOffsetTitle horizontal offset(1)numberHorizontal offset of title position, could be negative, to shift title to the left, or positive to shift title to the right(1)
xAxis, xAxisTitleX axis title(2)stringTitle of the X axis(2)
yAxis, yAxisTitleY axis title(2)stringTitle of the Y axis(2)
xAxisAngleX axis labels angle(1)numberRotates the x axis labels by the specified angle. Recommended values are: -45, +45, -90, +90.(1)
yAxisAngleY axis labels angle(1)numberRotates the y axis labels by the specified angle.(1)
xAxisFontSizeX axis labels font size(1)number
yAxisFontSizeY axis labels font size(1)number
xGridX axis grid(2)booleanShow grid lines for X axis(2)
yGridY axis grid(2)booleanShow grid lines for Y axis(2)
xTicks, xAxisTicksX axis ticks(2)numberHow many ticks to show on X axis. 7 by default. '-' value makes it automatic.(2)
yTicks, yAxisTicksY axis ticks(2)numberHow many ticks to show on Y axis. Auto '-' by default.(2)
vAnnotationsValuesRaw vertical annotation values(1)stringSupply all annotation values as a list of JSON objects: {"text": "Big event", "x": 1980}, ...(1)
hAnnotationsValuesRaw horizontal annotation values(1)stringSupply all horizontal annotation values as a list of JSON objects: {"text":"Big event", "y": 980}, ...(1)
vAnnotationsTableVertical annotation table(1)stringData page name on Commons, without the Data: prefix. The table must contain "x" column, and optional "text" and "color" columns.(1)
hAnnotationsTableHorizontal annotation table(1)stringData page name on Commons, without the Data: prefix. The table must contain "y" column, and optional "text" and "color" columns.(1)
vAnnotationsTransformsVertical annotation data transforms(1)string
hAnnotationsTransformsHorizontal annotation data transforms(1)string
legendLegend(2)stringTitle of the legend(2)
widthWidth(2)number
heightHeight(2)number
chartSizingChart sizing mode(1)stringChart sizing mode, could be one of: fit, pad. Vega default mode is `pad`. Use `fit` to force resulting chart canvas sizes to be exactly equal to provided width and height values. Use `pad` (or omit this parameter at all) to define prefered plotting size with provided width and height values, and let Vega increase overall chart size to include legend and title (if any)(1)
colorsColors(2)string"category10"The colors of the areas or bars, specified as Vega defined rangeliteral. This can also be a list like colors = [ "red", "green" ] or simply colors = red, green(2)
debugstringif set, will show graph as raw JSON(2)

Original work by User:Yurik

Data available under Creative Commons Zero.

Category:Data:TemplateData.tab