Format: Ro/2: Diferență între versiuni
De la alegeri.md
Oleg (Discuție | contribuții) |
Oleg (Discuție | contribuții) (→16) |
||
(Nu s-au afișat 3 versiuni intermediare efectuate de același utilizator) | |||
Linia 1: | Linia 1: | ||
+ | ===16=== | ||
+ | |||
+ | <graph>{ | ||
+ | "version":2, | ||
+ | "description":"Votarea peste hotarele Republicii Moldova", | ||
+ | "height":200, | ||
+ | "width":450, | ||
+ | // | ||
+ | "data": [ | ||
+ | { | ||
+ | "name":"table", | ||
+ | "values": [ | ||
+ | {"year":" 1994 ", "stations":6, "voters":1948}, | ||
+ | {"year":" 1996 ", "stations":14, "voters":3072}, | ||
+ | {"year":" 1998 ", "stations":20, "voters":3234}, | ||
+ | {"year":" 2001 ", "stations":20, "voters":3804}, | ||
+ | {"year":" 2005 ", "stations":23, "voters":10018}, | ||
+ | {"year":" 04/09 ", "stations":33, "voters":16914}, | ||
+ | {"year":" 07/09 ", "stations":33, "voters":17544}, | ||
+ | {"year":" 2010 ", "stations":75, "voters":64199}, | ||
+ | {"year":" 2014 ", "stations":95, "voters":73311}, | ||
+ | {"year":" 2016 ", "stations":100, "voters":67205}, | ||
+ | {"year":" 2019 ", "stations":123, "voters":76583}, | ||
+ | ] | ||
+ | } | ||
+ | ], | ||
+ | // | ||
+ | "signals": [ | ||
+ | { | ||
+ | "name":"tooltip", | ||
+ | "init": {}, | ||
+ | "streams": [ | ||
+ | {"type":"rect:mouseover", "expr":"datum"}, | ||
+ | {"type":"rect:mouseout", "expr":"{}"} | ||
+ | ] | ||
+ | } | ||
+ | ], | ||
+ | // | ||
+ | "predicates": [ | ||
+ | { | ||
+ | "name":"tooltip", "type":"==", | ||
+ | "operands": [{"signal":"tooltip._id"}, {"arg":"id"}] | ||
+ | } | ||
+ | ], | ||
+ | // | ||
+ | "scales": [ | ||
+ | { | ||
+ | "name":"x", | ||
+ | "type":"ordinal", | ||
+ | "range":"width", | ||
+ | "padding":0.64, | ||
+ | // "round":true, | ||
+ | "domain": {"data":"table", "field":"year"} | ||
+ | }, | ||
+ | { | ||
+ | "name":"y", | ||
+ | "type":"linear", | ||
+ | "range":"height", | ||
+ | "nice":true, | ||
+ | "domain": {"data":"table", "field":"stations"} | ||
+ | }, | ||
+ | { | ||
+ | "name":"y2", | ||
+ | "type":"linear", | ||
+ | "range":"height", | ||
+ | "nice":true, | ||
+ | "domain": {"data":"table", "field":"voters"} | ||
+ | } | ||
+ | ], | ||
+ | // | ||
+ | "axes": [ | ||
+ | { | ||
+ | "type":"x", | ||
+ | "scale":"x", | ||
+ | "properties": | ||
+ | { | ||
+ | "ticks": {"stroke": {"value":"#aaa"}}, | ||
+ | "labels": {"fill": {"value":"#666"}, "fontSize": {"value":12}}, | ||
+ | "axis": {"stroke": {"value":"#ccc"}} | ||
+ | } | ||
+ | }, | ||
+ | { | ||
+ | "type":"y", | ||
+ | "scale":"y", | ||
+ | "ticks":6, | ||
+ | "orient":"right", | ||
+ | "title":"Secții de votare", | ||
+ | "properties": | ||
+ | { | ||
+ | "ticks": {"stroke": {"value":"#d9d9d9"}}, | ||
+ | "labels": {"fill": {"value":"#666"}, "fontSize":{"value":12}}, | ||
+ | "axis": {"stroke": {"value":"#ccc"}}, | ||
+ | "title": {"fill": {"value":"#999"}, "fontSize": {"value":12}, "fontWeight": {"value":"italic"}, "x": {"value":-12}} | ||
+ | } | ||
+ | }, | ||
+ | { | ||
+ | "type":"y", | ||
+ | "scale":"y2", | ||
+ | "title":"Alegători", | ||
+ | "format":"s", | ||
+ | "grid":true, | ||
+ | "properties": | ||
+ | { | ||
+ | "ticks": {"stroke": {"value":"#d9d9d9"}}, | ||
+ | "labels": {"fill": {"value":"#666"}, "fontSize": {"value": 12}}, | ||
+ | "axis": {"stroke": {"value":"#ccc"}}, | ||
+ | "title": {"fill": {"value":"#a6c26b"}, "fontSize": {"value":12}, "fontWeight": {"value":"italic"}, "x": {"value":12}} | ||
+ | } | ||
+ | } | ||
+ | ], | ||
+ | // | ||
+ | "marks": [ | ||
+ | { | ||
+ | "type":"rect", | ||
+ | "from": {"data":"table"}, | ||
+ | "properties": { | ||
+ | "enter": { | ||
+ | "x": {"scale":"x", "field":"year"}, | ||
+ | "width": {"scale":"x", "band":true, "offset":0}, | ||
+ | "y": {"scale":"y", "field":"stations"}, | ||
+ | "y2": {"scale":"y", "value":0}, | ||
+ | }, | ||
+ | "update": {"fill": {"value":"#ccc"}}, | ||
+ | "hover": {"fill": {"value":"#999"}}, | ||
+ | } | ||
+ | }, | ||
+ | { | ||
+ | "type":"line", | ||
+ | "from": {"data":"table"}, | ||
+ | "properties": { | ||
+ | "enter": { | ||
+ | "x": {"scale":"x", "field":"year", "offset":7}, | ||
+ | "y": {"scale":"y2", "field":"voters"}, | ||
+ | "stroke": {"value":"#9bbb59"}, | ||
+ | "strokeWidth": {"value":2}, | ||
+ | //"interpolate": {"value":"linear"} | ||
+ | } | ||
+ | } | ||
+ | }, | ||
+ | { | ||
+ | "type":"symbol", | ||
+ | "from": {"data":"table"}, | ||
+ | "properties": { | ||
+ | "enter": { | ||
+ | "x": {"scale":"x", "field":"year", "offset":7}, | ||
+ | "y": {"scale":"y2", "field":"voters"}, | ||
+ | "stroke": {"value":"#9bbb59"}, | ||
+ | "fill": {"value":"white"}, | ||
+ | "size": {"value":20} | ||
+ | } | ||
+ | } | ||
+ | }, | ||
+ | { | ||
+ | "type":"text", | ||
+ | "properties": { | ||
+ | "enter": { | ||
+ | "align": {"value":"center"}, | ||
+ | "fill": {"value":"#666"}, | ||
+ | }, | ||
+ | "update": { | ||
+ | "x": {"scale":"x", "signal":"tooltip.year"}, | ||
+ | "dx": {"scale":"x", "mult":0.5, "band":true}, | ||
+ | "y": {"scale":"y", "offset":-4, "signal":"tooltip.stations"}, | ||
+ | "text": {"signal":"tooltip.stations"}, | ||
+ | "fontSize": {"value":12}, | ||
+ | "fillOpacity": { | ||
+ | "rule": [ | ||
+ | { | ||
+ | "predicate": {"name":"tooltip", "id": {"value":null}}, | ||
+ | "value":0 | ||
+ | }, | ||
+ | {"value":1} | ||
+ | ] | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | }, | ||
+ | { | ||
+ | "type":"text", | ||
+ | "properties": { | ||
+ | "enter": { | ||
+ | "x": {"signal":"width", "mult":0.5}, | ||
+ | "y": {"value":-10}, | ||
+ | "text": {"template":"Votarea în străinătate în perioada 1994–2019"}, | ||
+ | "fill": {"value":"#336"}, | ||
+ | "fontSize": {"value":15}, | ||
+ | "align": {"value":"center"}, | ||
+ | "fontWeight": {"value":"bold"} | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | ] | ||
+ | }</graph> | ||
+ | |||
===15=== | ===15=== | ||
Linia 242: | Linia 436: | ||
"y2": {"field": {"group":"height"}}, | "y2": {"field": {"group":"height"}}, | ||
"x": {"scale":"x", "value":29}, "stroke": {"value":"#ccc"}, | "x": {"scale":"x", "value":29}, "stroke": {"value":"#ccc"}, | ||
− | "strokeWidth": {"value": | + | "strokeWidth": {"value": 1}, "strokeDash": {"value": [3]} |
} | } | ||
} | } | ||
Linia 253: | Linia 447: | ||
"y2": {"field": {"group":"height"}}, | "y2": {"field": {"group":"height"}}, | ||
"x": {"scale":"x", "value":59}, "stroke": {"value":"#ccc"}, | "x": {"scale":"x", "value":59}, "stroke": {"value":"#ccc"}, | ||
− | "strokeWidth": {"value": | + | "strokeWidth": {"value": 1}, "strokeDash": {"value": [3]} |
} | } | ||
} | } | ||
Linia 264: | Linia 458: | ||
"y2": {"field": {"group":"height"}}, | "y2": {"field": {"group":"height"}}, | ||
"x": {"scale":"x", "value":90}, "stroke": {"value":"#ccc"}, | "x": {"scale":"x", "value":90}, "stroke": {"value":"#ccc"}, | ||
− | "strokeWidth": {"value": | + | "strokeWidth": {"value": 1}, "strokeDash": {"value": [3]} |
} | } | ||
} | } | ||
Linia 275: | Linia 469: | ||
"y2": {"field": {"group":"height"}}, | "y2": {"field": {"group":"height"}}, | ||
"x": {"scale":"x", "value":120}, "stroke": {"value":"#ccc"}, | "x": {"scale":"x", "value":120}, "stroke": {"value":"#ccc"}, | ||
− | "strokeWidth": {"value": | + | "strokeWidth": {"value": 1}, "strokeDash": {"value": [3]} |
} | } | ||
} | } | ||
Linia 286: | Linia 480: | ||
"y2": {"field": {"group":"height"}}, | "y2": {"field": {"group":"height"}}, | ||
"x": {"scale":"x", "value":151}, "stroke": {"value":"#ccc"}, | "x": {"scale":"x", "value":151}, "stroke": {"value":"#ccc"}, | ||
− | "strokeWidth": {"value": | + | "strokeWidth": {"value": 1}, "strokeDash": {"value": [3]} |
} | } | ||
} | } |