Plr : Différence entre versions
| (9 révisions intermédiaires par le même utilisateur non affichées) | |||
| Ligne 1 : | Ligne 1 : | ||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
{{#tag:graph| | {{#tag:graph| | ||
{ | { | ||
| − | " | + | "version": 2, |
| − | "width": | + | "width": 800, |
"height": 200, | "height": 200, | ||
| − | "padding": | + | "padding": {"top": 10, "left": 65, "bottom": 20, "right": 10}, |
"data": [ | "data": [ | ||
| Ligne 26 : | Ligne 10 : | ||
"name": "table", | "name": "table", | ||
"values": [ | "values": [ | ||
| − | {" | + | {"nom": "mich", "morts": 72 }, |
| − | {" | + | {"nom": "14-08", "morts": 63 }, |
| − | {" | + | {"nom": "14-09", "morts": 61 }, |
| − | {" | + | {"nom": "14-10", "morts": 41 }, |
| − | {" | + | {"nom": "14-11", "morts": 93 }, |
| − | {" | + | {"nom": "14-12", "morts": 73 }, |
| − | {" | + | {"nom": "15-01", "morts": 62 }, |
| − | {" | + | {"nom": "15-02", "morts": 65 }, |
| + | {"nom": "15-03", "morts": 47 }, | ||
| + | {"nom": "15-04", "morts": 52 }, | ||
| + | {"nom": "15-05", "morts": 50 }, | ||
| + | {"nom": "15-06", "morts": 39 }, | ||
| + | {"nom": "15-07", "morts": 69 }, | ||
| + | {"nom": "15-08", "morts": 49 }, | ||
| + | {"nom": "15-09", "morts": 29 }, | ||
| + | {"nom": "15-10", "morts": 32 }, | ||
| + | {"nom": "15-11", "morts": 49 }, | ||
| + | {"nom": "15-12", "morts": 34 }, | ||
] | ] | ||
} | } | ||
| Ligne 41 : | Ligne 35 : | ||
{ | { | ||
"name": "tooltip", | "name": "tooltip", | ||
| − | " | + | "init": {}, |
| − | " | + | "streams": [ |
| − | {" | + | {"type": "rect:mouseover", "expr": "datum"}, |
| − | {" | + | {"type": "rect:mouseout", "expr": "{}"} |
] | ] | ||
} | } | ||
], | ], | ||
| − | " | + | "predicates": [ |
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
{ | { | ||
| − | "name": " | + | "name": "tooltip", "type": "==", |
| − | + | "operands": [{"signal": "tooltip._id"}, {"arg": "id"}] | |
| − | |||
| − | |||
} | } | ||
| + | ], | ||
| + | |||
| + | "scales": [ | ||
| + | { "name": "xscale", "type": "ordinal", "range": "width", | ||
| + | "domain": {"data": "table", "field": "nom"} }, | ||
| + | { "name": "yscale", "type": "linear", "range": "height", "nice": true, | ||
| + | "domain": {"data": "table", "field": "morts"} } | ||
], | ], | ||
"axes": [ | "axes": [ | ||
| − | { " | + | { "type": "x", "scale": "xscale" }, |
| − | { " | + | { "type": "y", "scale": "yscale" } |
], | ], | ||
| Ligne 75 : | Ligne 66 : | ||
"type": "rect", | "type": "rect", | ||
"from": {"data":"table"}, | "from": {"data":"table"}, | ||
| − | " | + | "properties": { |
"enter": { | "enter": { | ||
| − | "x": {"scale": "xscale", "field": " | + | "x": {"scale": "xscale", "field": "nom"}, |
| − | "width": {"scale": "xscale", "band": 1}, | + | "width": {"scale": "xscale", "band": true, "offset": -1}, |
| − | "y": {"scale": "yscale", "field": " | + | "y": {"scale": "yscale", "field": "morts"}, |
| − | "y2": {" | + | "y2": {"field": {"group": "height"} } |
| − | |||
| − | |||
| − | |||
}, | }, | ||
| − | "hover": { | + | "update": { "fill": {"value": "steelblue"} }, |
| − | + | "hover": { "fill": {"value": "red"} } | |
| − | |||
} | } | ||
}, | }, | ||
{ | { | ||
"type": "text", | "type": "text", | ||
| − | " | + | "properties": { |
"enter": { | "enter": { | ||
"align": {"value": "center"}, | "align": {"value": "center"}, | ||
| − | |||
"fill": {"value": "#333"} | "fill": {"value": "#333"} | ||
}, | }, | ||
"update": { | "update": { | ||
| − | "x": {"scale": "xscale", "signal": "tooltip. | + | "x": {"scale": "xscale", "signal": "tooltip.nom"}, |
| − | "y": {"scale": "yscale", "signal": "tooltip. | + | "dx": {"scale": "xscale", "band": true, "mult": 0.5}, |
| − | "text": {"signal": "tooltip. | + | "y": {"scale": "yscale", "signal": "tooltip.morts", "offset": -5}, |
| − | "fillOpacity": [ | + | "text": {"signal": "tooltip.morts"}, |
| − | + | "fillOpacity": { | |
| − | + | "rule": [ | |
| − | + | { | |
| + | "predicate": {"name": "tooltip", "id": {"value": null} }, | ||
| + | "value": 0 | ||
| + | }, | ||
| + | {"value": 1} | ||
| + | ] | ||
| + | } | ||
} | } | ||
} | } | ||
| Ligne 111 : | Ligne 103 : | ||
] | ] | ||
} | } | ||
| − | }} | + | | mode=interactive }} |