{ "transform": [ { "window": [ { "op": "sum", "field": "value", "as": "NbPublisPerYear" } ], "frame": [ null, null ] }, { "calculate": "round(datum.value*1000/datum.NbPublisPerYear)/1000", "as": "Taux" } ], "layer": [ { "mark": { "type": "bar" }, "encoding": { "x": { "field": "_id", "type": "nominal", "axis": { "labelAngle": 0, "tickMinStep": 1 }, "title": "", "sort": [ "Diamond", "Gold", "Green", "Bronze", "Hybrid", "Closed" ] }, "y": { "field": "value", "type": "quantitative", "axis": { "labelAngle": 0, "tickMinStep": 1 }, "scale": { "type": "linear" }, "title": "" }, "color": { "field": "_id", "scale": { "domain": [ "Diamond", "Gold", "Green", "Bronze", "Hybrid", "Closed" ], "range": [ "#00bfff", "#f9bc01", "#228B22", "#c97522", "#ffff67", "#7f7f7f" ] }, "type": "nominal", "legend": null }, "tooltip": [ { "field": "_id", "type": "nominal", "title": "Voie d'accès" }, { "field": "value", "type": "quantitative", "title": "Nb publis" }, { "field": "Taux", "title": "Taux de publication", "format": ".1%", "type": "quantitative" } ], "size": { "value": 50 } } }, { "mark": { "type": "text", "color": "black", "fontSize": 10, "fontWeight": "bold", "baseline": "bottom", "align": "center", "dx": 0 }, "encoding": { "x": { "field": "_id", "type": "nominal", "title": "", "sort": [ "diamond", "gold", "green", "bronze", "hybrid", "closed" ] }, "y": { "field": "value", "type": "quantitative", "axis": null }, "text": { "field": "value", "type": "quantitative" } } } ], "padding": { "left": 0, "right": 0, "top": 0, "bottom": 0 }, "config": { "view": { "strokeWidth": 0 } }, "width": 600, "height": 300 }