User:Shattered Gnome/sandbox
Appearance
This file is a testbed for a new revision of {{Module:Chart}} that is found at {{Module:Chart/sandbox}}
Source | Result | |
---|---|---|
Basic Bar graph | {{ #invoke:Chart/sandbox | bar chart | group 1 = 40 : 50 : 60 : 20 | group 2 = 20 : 60 : 12 : 44 | group 3 = 55 : 14 : 33 : 5 | links 1 = Apple : McIntosh : Golden delicious | links 2 = Banana : Apricot : Peach | links 3 = Orange : Pear : Bear | tooltip 2 = tooltip 1 : tooltip 2 : tooltip 3 : tooltip 4 | colors = green : yellow : orange | group names = Apple : Banana : Orange | x legends = Before : During : After : Postmortem }} |
10
20
30
40
50
60
Before
During
After
Postmortem
|
Stacked Bar graph | {{ #invoke:Chart/sandbox | bar chart | height = 250 | width = 300 | stack = 1 | group 1 = 40 : 50 : 60 : 20 | group 2 = 20 : 60 : 12 : 44 | group 3 = 55 : 14 : 33 : 5 | colors = green : yellow : orange | group names = Apple : Banana : Orange | units suffix = Kg | x legends = Before : During : After : Postmortem }} |
25
50
75
100
125
150
Before
During
After
Postmortem
|
Scale per group
Notice the "units prefix" field: we do not need prefix for the first 2 groups, so we use colons with no content. we could write "::$" instead of " : : $". Also note the special tooltip for the "Cars" number for 1965. |
{{ #invoke:Chart/sandbox | bar chart | width = 800 | group 1 = 1500000 : 2500000 : 3500000 | group 2 = 200 : 5000 : 45000 | group 3 = 2000 : 5000 : 20000 | colors = red : blue : green | group names = People : Cars : Average car cost | x legends = 1920 : 1965 : 2002 | tooltip 2 = : There is no good data for number of cars in 1965. we use 5,000 as best estimate | units prefix = : : $ | scale per group = 1 }} |
1,000,000
2,000,000
3,000,000
4,000,000
10,000
20,000
30,000
40,000
50,000
5,000
10,000
15,000
20,000
1920
1965
2002
|
Here is an example with large number of groups - mainly to test how does it look with large number of legends. | {{ #invoke:Chart/sandbox | bar chart | width = 800 | height = 550 | group 1 = 1:2:3:4:5:4:3:2:1 | group 2 = 1:2:3:4:5:4:3:2:1 | group 3 = 1:2:3:4:5:4:3:2:1 | group 4 = 1:2:3:4:5:4:3:2:1 | group 5 = 1:2:3:4:5:4:3:2:1 | group 6 = 1:2:3:4:5:4:3:2:1 | group 7 = 1:2:3:4:5:4:3:2:1 | group 8 = 1:2:3:4:5:4:3:2:1 | group 9 = 1:2:3:4:5:4:3:2:1 | group 10 = 1:2:3:4:5:4:3:2:1 | group 11 = 1:2:3:4:5:4:3:2:1 | group 12 = 1:2:3:4:5:4:3:2:1 | group 13 = 1:2:3:4:5:4:3:2:1 | group 14 = 1:2:3:4:5:4:3:2:1 | group 15 = 1:2:3:4:5:4:3:2:1 | group 16 = 1:2:3:4:5:4:3:2:1 | group 17 = 1:2:3:4:5:4:3:2:1 | group 18 = 1:2:3:4:5:4:3:2:1 | group 19 = 1:2:3:4:5:4:3:2:1 | group 20 = 1:2:3:4:5:4:3:2:1 | group 21 = 1:2:3:4:5:4:3:2:1 | colors = Silver:Gray:Black:Red:Maroon:Yellow:Olive: Lime:Green:Aqua:Teal:Blue:Navy:Fuchsia:Purple:ForestGreen: Tomato:LightSeaGreen:RosyBrown:DarkOliveGreen:MediumVioletRed | group names = Alabama:Alaska:Arizona:Arkansas:California: Colorado:Connecticut:Delaware:Florida:Georgia:Hawaii:Idaho:Illinois :Indiana:Iowa:Kansas:Kentucky:Louisiana:Maine:Maryland:Massachusetts | x legends = 1920 : 1930 : 1940: 1950 : 1960 : 1970 : 1990 : 2000 : 2010 | units prefix = $ | units suffix = _Billion | stack = 1 }} |
25
50
75
100
125
150
1920
1930
1940
1950
1960
1970
1990
2000
2010
|
x legends can be diluted by using delimiters with nothing in between | {{ #invoke:Chart/sandbox | bar chart | group 1 = 1:2:3:4:5:6:7:8:9:10:11:12:13:14:15:16:17:18:19:20: 21:22:23:24:25:26:27:28:29:30:31:32:33:34:35:36:37:38:39:40 :41:42:43:44:45:46:47:48:49:50:51:52:53:54:55:56:57:58:59 | units suffix = _Things | group names = Some | x legends = ::::1940::::::::::1950:::::::::: 1960::::::::::1970::::::::::1980::::::::::1990:::: }} |
10
20
30
40
50
60
1940
1950
1960
1970
1980
1990
|
pie chart | {{#invoke:Chart/sandbox |pie chart | radius = 150 | slices = ( 1000000 : Apples ) ( 2000000 : Bananas : gold) ( 1440000 : Apricots ) ( 6.4e5 : Pears : : [[Pear|Pears]] ) ( 750,000 : Pineapples ) | units suffix = _Tonne | percent = true }} |
|
alternative syntax with "slice 1", "slice 2" etc. | {{#invoke:chart/sandbox |pie chart |radius= 200 |units suffix = _Units | slice 1 = 1 : 1 | slice 2 = 7 : 7 | slice 3 = 8 : 8 | slice 4 = 9 : 9 | slice 5 = 10 : 10 | slice 6 = 11 : 11 | slice 7 = 12 : 12 | slice 8 = 13 : 13 | slice 9 = 14 : 14 | slice 10 = 15 : 15 | slice 11 = 16 : 16 | slice 12 = 17 : 17 | slice 13 = 18 : 18 | slice 14 = 19 : 19 | slice 15 = 20 : 20 | slice 16 = 21 : 21 | slice 17 = 22 : 22 | slice 18 = 23 : 23 | slice 19 = 24 : 24 | slice 20 = 25 : 25 | slice 21 = 26 : 26 | slice 22 = 27 : 27 | slice 23 = 28 : 28 | slice 24 = 29 : 29 | slice 25 = 30 : 30 | slice 26 = 31 : 31 | percent = true }} |
|