{ "width": "container", "height": 450, "transform": [ { "window": [ { "op": "sum", "field": "value", "as": "NbPublisPerYear" } ] }, { "calculate": "round(datum.value*1000/datum.NbPublisPerYear)/1000", "as": "Taux" }, { "window": [ { "op": "rank", "as": "rank" } ], "sort": [ { "field": "value", "order": "descending" } ] }, { "calculate": "datum.rank - 1", "as": "rank_minus_1" } ], "layer": [ { "mark": { "type": "arc", "innerRadius": 120 }, "encoding": { "theta": { "field": "value", "type": "quantitative", "stack": true }, "color": { "field": "_id", "type": "nominal", "legend": { "orient": "right", "title": "Voie d'accès", "columns": 1 }, "scale": { "domain": [ "Diamond", "Gold", "Green", "Bronze", "Hybrid", "Closed" ], "range": [ "#00bfff", "#f9bc01", "#228B22", "#c97522", "#ffff67", "#7f7f7f" ] } }, "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" } ], "order": { "field": "rank_minus_1" } } }, { "mark": { "type": "text", "fill": "black", "radius": 165, "fontSize": 14 }, "encoding": { "theta": { "field": "value", "type": "quantitative", "stack": true }, "text": { "field": "value", "type": "nominal" }, "color": { "field": "_id", "type": "nominal" }, "order": { "field": "rank_minus_1" } } } ], "view": { "stroke": null }, "background": "transparent" }