Template:Graph:Stacked/testcases

From mediawiki.org

Test legend ordering with explicate `series` parameter[edit]

Series order and legend order should match each other

series="TX","NY","CA" ( colors=#1f77b4, #ff7f0e, #2ca02c )[edit]

See or edit source data.

series="NY","CA","TX" ( colors=#ff7f0e, #2ca02c, #1f77b4 )[edit]

See or edit source data.

series="TX","NY","CA" ( colors=#2ca02c, #1f77b4, #ff7f0e )[edit]

See or edit source data.

Test dataset optional filtering (e.g. for limiting x-axis displayed range)[edit]

without filtering (default width)[edit]

See or edit source data.

filter = 2000 <= datum.year && datum.year <= 2010[edit]

See or edit source data.

filter = datum.year <= 2010[edit]

See or edit source data.

Test optional arbitrary ("raw") data transforms[edit]

filter = 2000 <= datum.year && datum.year <= 2010[edit]

See or edit source data.

dataTransforms = { "type": "filter", ... }, { "type": "filter", ... }[edit]

See or edit source data.

Test different colors list formats[edit]

colors=["#1f77b4", "#ff7f0e", "#2ca02c"][edit]

See or edit source data.

colors=["rgba(31,119,180,80%)", "rgba(255,127,14,80%)", "rgba(44,160,44,80%)"][edit]

See or edit source data.

colors=rgb(31 119 180 / 70%), rgb(255 127 14 / 70%), rgb(44 160 44 / 70%)[edit]

See or edit source data.

colors="category20"[edit]

See or edit source data.

colorscheme=category20[edit]

See or edit source data.

Test chart sizing (enabling/disabling chart width grows)[edit]

without explicit `chartSizing` (default chart sizing model)[edit]

See or edit source data.
See or edit source data.

chartSizing=fit | chartSizing=padding-box[edit]

See or edit source data.
See or edit source data.
See or edit source data.

chartSizing=pad | chartSizing=content-box[edit]

See or edit source data.
See or edit source data.

Test chart title positioning[edit]

default chart title positioning[edit]

See or edit source data.
See or edit source data.

titleXAlign=left[edit]

See or edit source data.
See or edit source data.

titleXAlign=right[edit]

See or edit source data.
See or edit source data.

titleXAlign=center[edit]

See or edit source data.
See or edit source data.

titleXAlign=center | titleXOffset=80[edit]

See or edit source data.

Test axis domain min/max values values + clamping[edit]

It is possible to extend axis scales. And it is possible to shrink axis scale by manually providing scale domain min/max values, however without having "clamp":true it will not crop data plotting itself, but only affect axis positioning on graph, while adding "clamp":true actually applies data plotting cropping.

type=year[edit]

xAxisMin=1994 | xAxisMax=2020 | yAxisMax=8000000[edit]

See or edit source data.
See or edit source data.

xAxisMin=1999 | xAxisMax=2014 | yAxisMax=4500000 | (without clamping)[edit]

See or edit source data.
See or edit source data.

xAxisMin=1999 | xAxisMax=2014 | yAxisMax=4500000 | xAxisClamp=true | yAxisClamp=true[edit]

See or edit source data.
See or edit source data.

type=linear[edit]

xAxisZero=false | xAxisMin=1994 | xAxisMax=2020 | yAxisMax=8000000[edit]

See or edit source data.
See or edit source data.

xAxisZero=false | xAxisMin=1999 | xAxisMax=2014 | yAxisMax=4500000 | xAxisClamp=true | yAxisClamp=true[edit]

See or edit source data.
See or edit source data.

Test axis marks font size, angle + test legend labels transform[edit]

xAxisAngle = -25 | xAxisFontSize = 20 | yAxisAngle = 25 | yAxisFontSize = 20 | labelsTransforms = { ... }[edit]

See or edit source data.

Test annotations[edit]

type=year[edit]

hAnnotationsValues = {"text": "v 4.75", "y": 4750000} | vAnnotationsValues = {"text": "v 2002", "x": 2002}[edit]

See or edit source data.


See or edit source data.

hAnnotationsTable = ... | hAnnotationsTransforms = ... | vAnnotationsTable = ... | vAnnotationsTransforms = ...[edit]

See or edit source data.


See or edit source data.

type=linear[edit]

hAnnotationsValues = {"text": "v 4.75", "y": 4750000} | vAnnotationsValues = {"text": "v 2002", "x": 2002}[edit]

See or edit source data.


See or edit source data.

hAnnotationsTable = ... | hAnnotationsTransforms = ... | vAnnotationsTable = ... | vAnnotationsTransforms = ...[edit]

See or edit source data.


See or edit source data.