Format: Ro: Diferență între versiuni
De la alegeri.md
Oleg (Discuție | contribuții) |
Oleg (Discuție | contribuții) |
||
Linia 5: | Linia 5: | ||
<!-- | <!-- | ||
<graph>{ | <graph>{ | ||
− | + | "width": 500, | |
− | |||
"height": 200, | "height": 200, | ||
"padding": {"top": 10, "left": 30, "bottom": 30, "right": 10}, | "padding": {"top": 10, "left": 30, "bottom": 30, "right": 10}, | ||
Linia 13: | Linia 12: | ||
"name": "table", | "name": "table", | ||
"values": [ | "values": [ | ||
− | {"x": | + | {"x": 0, "y": 28, "c":0}, {"x": 0, "y": 55, "c":1}, |
− | {"x": | + | {"x": 1, "y": 43, "c":0}, {"x": 1, "y": 91, "c":1}, |
− | {"x": | + | {"x": 2, "y": 81, "c":0}, {"x": 2, "y": 53, "c":1}, |
− | {"x": | + | {"x": 3, "y": 19, "c":0}, {"x": 3, "y": 87, "c":1}, |
− | {"x": | + | {"x": 4, "y": 52, "c":0}, {"x": 4, "y": 48, "c":1}, |
− | {"x": | + | {"x": 5, "y": 24, "c":0}, {"x": 5, "y": 49, "c":1}, |
− | {"x": | + | {"x": 6, "y": 87, "c":0}, {"x": 6, "y": 66, "c":1}, |
− | {"x": | + | {"x": 7, "y": 17, "c":0}, {"x": 7, "y": 27, "c":1}, |
− | {"x": | + | {"x": 8, "y": 68, "c":0}, {"x": 8, "y": 16, "c":1}, |
− | {"x": | + | {"x": 9, "y": 49, "c":0}, {"x": 9, "y": 15, "c":1} |
+ | ] | ||
+ | }, | ||
+ | { | ||
+ | "name": "stats", | ||
+ | "source": "table", | ||
+ | "transform": [ | ||
+ | {"type": "facet", "keys": ["data.x"]}, | ||
+ | {"type": "stats", "value": "data.y"} | ||
] | ] | ||
} | } | ||
Linia 29: | Linia 36: | ||
{ | { | ||
"name": "x", | "name": "x", | ||
− | "type": " | + | "type": "ordinal", |
"range": "width", | "range": "width", | ||
− | |||
"domain": {"data": "table", "field": "data.x"} | "domain": {"data": "table", "field": "data.x"} | ||
}, | }, | ||
Linia 39: | Linia 45: | ||
"range": "height", | "range": "height", | ||
"nice": true, | "nice": true, | ||
− | "domain": {"data": " | + | "domain": {"data": "stats", "field": "sum"} |
+ | }, | ||
+ | { | ||
+ | "name": "color", | ||
+ | "type": "ordinal", | ||
+ | "range": "category10" | ||
} | } | ||
], | ], | ||
"axes": [ | "axes": [ | ||
− | {"type": "x", "scale": "x" | + | {"type": "x", "scale": "x"}, |
{"type": "y", "scale": "y"} | {"type": "y", "scale": "y"} | ||
], | ], | ||
"marks": [ | "marks": [ | ||
{ | { | ||
− | "type": " | + | "type": "group", |
− | "from": {"data": "table"}, | + | "from": { |
− | "properties": { | + | "data": "table", |
− | + | "transform": [ | |
− | + | {"type": "facet", "keys": ["data.c"]}, | |
− | + | {"type": "stack", "point": "data.x", "height": "data.y"} | |
− | + | ] | |
− | + | }, | |
− | + | "marks": [ | |
− | + | { | |
− | + | "type": "rect", | |
− | + | "properties": { | |
− | + | "enter": { | |
− | + | "x": {"scale": "x", "field": "data.x"}, | |
− | + | "width": {"scale": "x", "band": true, "offset": -1}, | |
+ | "y": {"scale": "y", "field": "y"}, | ||
+ | "y2": {"scale": "y", "field": "y2"}, | ||
+ | "fill": {"scale": "color", "field": "data.c"} | ||
+ | }, | ||
+ | "update": { | ||
+ | "fillOpacity": {"value": 1} | ||
+ | }, | ||
+ | "hover": { | ||
+ | "fillOpacity": {"value": 0.5} | ||
+ | } | ||
+ | } | ||
} | } | ||
− | + | ] | |
− | } | + | } |
] | ] | ||
}</graph> | }</graph> |
Versiunea de la data 31 iulie 2020 14:10
18293 / 2018 | 18793 / 2018 | 147 / 2019 |