Sandbox: mudanças entre as edições
imported>Admin (Criou página com 'Página de testes. Para página de Manutenção.{{Aviso|Esta página é de manutenção. Aqui se testa recursos e extensões deste wiki.}} == Título (2 =) == === Subtítulo 1 (3 =) === ==== Subtítulo 2 (4 =) ==== ===== Subtítulo 3 (5 =) ===== ====== Subtítulo 4 (6 =) ====== Pré-formatado (um espaço antes do parágrafo) <blockquote><nowiki><blockquote> Bloco de citação </blockquote></nowiki></blockquote> <code><nowiki><code> Código </code></nowiki></co...') |
imported>Admin |
||
Linha 84: | Linha 84: | ||
== Gráficos == | == Gráficos == | ||
=== Funcionando === | |||
Teste de gráficos com dados JSON. | |||
'''Gráfico de barras:''' | |||
<graph> | |||
{ | |||
"width": 400, | |||
"height": 200, | |||
"padding": {"top": 10, "left": 30, "bottom": 30, "right": 10}, | |||
"data": [ | |||
{ | |||
"name": "table", | |||
"values": [ | |||
{"x": 1, "y": 28}, {"x": 2, "y": 55}, | |||
{"x": 3, "y": 43}, {"x": 4, "y": 91}, | |||
{"x": 5, "y": 81}, {"x": 6, "y": 53}, | |||
{"x": 7, "y": 19}, {"x": 8, "y": 87}, | |||
{"x": 9, "y": 52}, {"x": 10, "y": 48}, | |||
{"x": 11, "y": 24}, {"x": 12, "y": 49}, | |||
{"x": 13, "y": 87}, {"x": 14, "y": 66}, | |||
{"x": 15, "y": 17}, {"x": 16, "y": 27}, | |||
{"x": 17, "y": 68}, {"x": 18, "y": 16}, | |||
{"x": 19, "y": 49}, {"x": 20, "y": 15} | |||
] | |||
} | |||
], | |||
"scales": [ | |||
{ | |||
"name": "x", | |||
"type": "ordinal", | |||
"range": "width", | |||
"domain": {"data": "table", "field": "x"} | |||
}, | |||
{ | |||
"name": "y", | |||
"type": "linear", | |||
"range": "height", | |||
"domain": {"data": "table", "field": "y"}, | |||
"nice": true | |||
} | |||
], | |||
"axes": [ | |||
{"type": "x", "scale": "x"}, | |||
{"type": "y", "scale": "y"} | |||
], | |||
"marks": [ | |||
{ | |||
"type": "rect", | |||
"from": {"data": "table"}, | |||
"properties": { | |||
"enter": { | |||
"x": {"scale": "x", "field": "x"}, | |||
"width": {"scale": "x", "band": true, "offset": -1}, | |||
"y": {"scale": "y", "field": "y"}, | |||
"y2": {"scale": "y", "value": 0} | |||
}, | |||
"update": { | |||
"fill": {"value": "steelblue"} | |||
}, | |||
"hover": { | |||
"fill": {"value": "red"} | |||
} | |||
} | |||
} | |||
] | |||
} | |||
</graph> | |||
<br> | |||
'''Gráfico de linhas:''' | |||
<graph> | |||
{ | |||
"width": 500, | |||
"height": 200, | |||
"padding": {"top": 10, "left": 30, "bottom": 30, "right": 10}, | |||
"data": [ | |||
{ | |||
"name": "table", | |||
"values": [ | |||
{"x": 1, "y": 28}, {"x": 2, "y": 55}, | |||
{"x": 3, "y": 43}, {"x": 4, "y": 91}, | |||
{"x": 5, "y": 81}, {"x": 6, "y": 53}, | |||
{"x": 7, "y": 19}, {"x": 8, "y": 87}, | |||
{"x": 9, "y": 52}, {"x": 10, "y": 48}, | |||
{"x": 11, "y": 24}, {"x": 12, "y": 49}, | |||
{"x": 13, "y": 87}, {"x": 14, "y": 66}, | |||
{"x": 15, "y": 17}, {"x": 16, "y": 27}, | |||
{"x": 17, "y": 68}, {"x": 18, "y": 16}, | |||
{"x": 19, "y": 49}, {"x": 20, "y": 15} | |||
] | |||
} | |||
], | |||
"scales": [ | |||
{ | |||
"name": "x", | |||
"type": "linear", | |||
"range": "width", | |||
"zero": false, | |||
"domain": {"data": "table", "field": "x"} | |||
}, | |||
{ | |||
"name": "y", | |||
"type": "linear", | |||
"range": "height", | |||
"nice": true, | |||
"domain": {"data": "table", "field": "y"} | |||
} | |||
], | |||
"axes": [ | |||
{"type": "x", "scale": "x", "ticks": 20}, | |||
{"type": "y", "scale": "y"} | |||
], | |||
"marks": [ | |||
{ | |||
"type": "area", | |||
"from": {"data": "table"}, | |||
"properties": { | |||
"enter": { | |||
"interpolate": {"value": "monotone"}, | |||
"x": {"scale": "x", "field": "x"}, | |||
"y": {"scale": "y", "field": "y"}, | |||
"y2": {"scale": "y", "value": 0}, | |||
"fill": {"value": "steelblue"} | |||
}, | |||
"update": { | |||
"fillOpacity": {"value": 1} | |||
}, | |||
"hover": { | |||
"fillOpacity": {"value": 0.5} | |||
} | |||
} | |||
} | |||
] | |||
} | |||
</graph> | |||
=== Não funcionando === | |||
Os gráficos abaixo não funcionam. | |||
Falta implementar a Predefinição (usar isto https://www.mediawiki.org/wiki/Extension:Scribunto - ver se já está instalado): | |||
{{Graph:Chart|width=600|height=100|xAxisTitle=X|yAxisTitle=Y | |||
|type=rect|x=Item 1, Item 2, Item 3, Item 4, Item 5, Item 6, Item 7, Item 8|y=10,12,6,14,2,10,7,9}} | |||
{{Graph:Chart|width=100|height=100|type=pie|legend=Legenda | |||
|x=Item A,Item B,Item C,Item D,Item E,Item F,Item G,Item H,Item I|y1=100,200,150,300,100,100,150,50,200 | |||
|y2=7,8,9,8,8,9,10,9,5|showValues=}} | |||
{{Graph:Chart|width=400|height=100|xAxisTitle=X|yAxisTitle=Y | |||
|legend=Legend|type=stackedarea|x=1,2,3,4,5,6|y1=10,12,6,14,2,10 | |||
|y2=2,4,6,8,13,11|interpolate=monotone|colors=seagreen,orchid}} | |||
== Mapas == | == Mapas == |