Template:Graph:Chart political/doc
Appearance
This is a documentation subpage for Template:Graph:Chart political. It may contain usage information, categories and other content that is not part of the original template page. |
This template uses Lua: |
This template is a wrapper for Template:Graph:Chart with party colors and short names from Module:Political party.
Usage
[edit]The syntax for this template is identical to Template:Graph:Chart, with one difference. If you use |y1Party=
instead of |y1Title=
then title is set to the party short name, and the color for the line is set to the party color. All the other parameters are pass through to Template:Graph:Chart unchanged. To override a particular title or color, just manually specify it in the inputs.
Examples
[edit]Opinion polling
[edit]In this example, all the titles and colors are determined by Module:Political party
{{Graph:Chart political
| legend=Party
| width=350
| height=200
| interpolate = basis
| showSymbols = yes
| type=line
| xAxisAngle = -40
| xAxisTitle=
| xType = date
| x= 1993/09/9, 1993/09/14, 1993/09/20, 1993/09/25, 1993/09/26, 1993/09/26, 1993/09/30, 1993/10/02, 1993/10/08, 1993/10/16, 1993/10/19, 1993/10/22, 1993/10/22, 1993/10/25,
| yGrid =
| yAxisFormat = %
| yAxisTitle=support
| y1Party=Progressive Conservative Party of Canada
| y1= 0.35, 0.36, 0.35, 0.30, 0.31, 0.28, 0.25, 0.26, 0.22, 0.22, 0.21, 0.18, 0.16, 0.1604,
| y2Party=Liberal Party of Canada
| y2= 0.37, 0.33, 0.35, 0.37, 0.36, 0.34, 0.39, 0.38, 0.37, 0.40, 0.39, 0.43, 0.44, 0.4124,
| y3Party=New Democratic Party of Canada
| y3= 0.08, 0.08, 0.06, 0.08, 0.07, 0.07, 0.06, 0.08, 0.08, 0.07, 0.06, 0.07, 0.07, 0.0688,
| y4Party=Bloc Québécois
| y4= 0.08, 0.10, 0.11, 0.10, 0.11, 0.12, 0.12, 0.12, 0.12, 0.13, 0.14, 0.14, 0.12, 0.1352,
| y5Party=Reform Party of Canada
| y5= 0.10, 0.11, 0.11, 0.13, 0.13, 0.15, 0.17, 0.14, 0.18, 0.16, 0.17, 0.18, 0.19, 0.1869,
}}
which results in
Graphs are unavailable due to technical issues. There is more info on Phabricator and on MediaWiki.org. |
Override title and color
[edit]To override the title and colors for the Reform Party, add
| y5Title=Wikipedia Party
| colors=,,,,silver
to the first example, which results in
Graphs are unavailable due to technical issues. There is more info on Phabricator and on MediaWiki.org. |
Election results of 16 parties in 12 states
[edit]{{Graph:Chart political
| colors = ,,,
,{{party color|Independent politician}},,
,,,
,,,
,,,
| height=250
| legend=Party
| type=stackedrect
| width=200
| x=Zeeland, Flevoland, Groningen,
Friesland, Drenthe, Overijssel,
Limburg, Utrecht, Gelderland,
North Holland, South Holland, North Brabant,
| xAxisAngle=90
| yGrid=
| y1Party=50PLUS
| y1=0,1,0, 0,0,0, 1,1,1, 2,1,1
| y2Party=Volt Netherlands
| y2=0,0,1, 0,1,1, 0,2,2, 2,1,1
| y3Party=Forum for Democracy (Netherlands)
| y3=1,2,1, 1,1,1, 1,1,1, 2,2,1
| y4Party=Reformed Political Party
| y4=5,2,0, 0,0,2, 0,2,3, 0,2,0.5
| y5Title=Provincial parties
| y5=2,1,4, 5,1,0, 2,0,1, 0,0,2
| y6Party=JA21
| y6=1,2,0, 1,1,1, 2,2,2, 3,3,2
| y7Party=Socialist Party (Netherlands)
| y7=1,2,2, 1,2,1, 3,1,1, 2,2,4
| y8Party=Christian Union (Netherlands)
| y8=1,2,3, 2,2,3, 0,3,3, 1,2,0.5
| y9Party=Party for the Animals
| y9=1,2,2, 1,2,2, 2,3,2, 4,3,2
| y10Party=Democrats 66
| y10=1,2,2, 1,1,2, 3,5,3, 4,4,4
| y11Party=Party for Freedom
| y11=2,3,2, 2,2,2, 6,2,2, 3,4,4
| y12Party=Christian Democratic Appeal
| y12=5,2,2, 4,3,4, 5,4,4, 2,4,4
| y13Party=Labour Party (Netherlands)
| y13=3,3,5, 5,4,3, 3,3,5, 7,4,4
| y14Party=GroenLinks
| y14=3,3,5, 3,2,4, 4,7,4, 6,6,5
| y15Party=People's Party for Freedom and Democracy
| y15=4,4,2, 3,4,4, 5,6,6, 8,8,9
| y16Party=Farmer–Citizen Movement
| y16=9,10,12, 14,17,17, 10,7,15, 9,9,11
}}
Graphs are unavailable due to technical issues. There is more info on Phabricator and on MediaWiki.org. |
Majority of seats
[edit]{{Graph:Chart political
| colors={{Party color|Republican Party (US)}}, {{Party color|Democratic Party (US)}}
| innerRadius=25
| legend=House seats 2022
| showValues=offset:5, fontsize:10
| type = pie
| width = 50
| x={{Party shortname|Republican Party (US)}}, {{Party shortname|Democratic Party (US)}}
| y=222,213
}}
Graphs are unavailable due to technical issues. There is more info on Phabricator and on MediaWiki.org. |
See also
[edit]- {{Graph:Chart}}
- {{Party color}}
- {{Party shortname}}