Vorlage:Graph:ToteNachAutorInnenRelativ: Unterschied zwischen den Versionen
Zur Navigation springen
Zur Suche springen
Void (Diskussion | Beiträge) (Verwendung AutorIn/AutorInnen-Feld aufgeräumt) |
Void (Diskussion | Beiträge) (Umstellung auf mehrere KandidatInnen) |
||
Zeile 21: | Zeile 21: | ||
"name": "table", | "name": "table", | ||
"values": {{Data:Folgen}}, | "values": {{Data:Folgen}}, | ||
− | "transform": [{ | + | "transform": [ |
+ | { | ||
"type": "formula", | "type": "formula", | ||
"field": "AutorInnen", | "field": "AutorInnen", | ||
"expr": "datum.AutorInnen ? datum.AutorInnen : [datum.AutorIn]" | "expr": "datum.AutorInnen ? datum.AutorInnen : [datum.AutorIn]" | ||
− | },{ | + | }, |
+ | { | ||
"type": "fold", | "type": "fold", | ||
"fields": ["AutorInnen[0]", "AutorInnen[1]", "AutorInnen[2]", "AutorInnen[3]", "AutorInnen[4]", "AutorInnen[5]", "AutorInnen[6]", "AutorInnen[7]", "AutorInnen[8]", "AutorInnen[9]"] | "fields": ["AutorInnen[0]", "AutorInnen[1]", "AutorInnen[2]", "AutorInnen[3]", "AutorInnen[4]", "AutorInnen[5]", "AutorInnen[6]", "AutorInnen[7]", "AutorInnen[8]", "AutorInnen[9]"] | ||
− | },{ | + | }, |
+ | { | ||
"type": "filter", | "type": "filter", | ||
"test": "datum.value" | "test": "datum.value" | ||
− | },{ | + | }, |
+ | { | ||
+ | "type": "formula", | ||
+ | "field": "AutorIn", | ||
+ | "expr": "datum.value" | ||
+ | }, | ||
+ | { | ||
+ | "type": "fold", | ||
+ | "fields": ["KandidatInnen[0]", "KandidatInnen[1]", "KandidatInnen[2]", "KandidatInnen[3]", "KandidatInnen[4]", "KandidatInnen[5]", "KandidatInnen[6]", "KandidatInnen[7]", "KandidatInnen[8]", "KandidatInnen[9]"] | ||
+ | }, | ||
+ | { | ||
+ | "type": "filter", | ||
+ | "test": "datum.value" | ||
+ | }, | ||
+ | { | ||
+ | "type": "formula", | ||
+ | "field": "KandidatInGestorben", | ||
+ | "expr": "datum.value.Gestorben" | ||
+ | }, | ||
+ | { | ||
"type": "aggregate", | "type": "aggregate", | ||
− | "groupby": [" | + | "groupby": ["AutorIn"], |
"summarize": [{ | "summarize": [{ | ||
"field": "KandidatInGestorben", | "field": "KandidatInGestorben", | ||
Zeile 41: | Zeile 63: | ||
"field": "*", | "field": "*", | ||
"ops": ["count"], | "ops": ["count"], | ||
− | "as": [" | + | "as": ["AnzahlKandidatInnen"] |
}] | }] | ||
− | },{ | + | }, |
+ | { | ||
"type": "filter", | "type": "filter", | ||
"test": "datum.AnzahlGestorben > 0" | "test": "datum.AnzahlGestorben > 0" | ||
− | },{ | + | }, |
+ | { | ||
"type": "formula", | "type": "formula", | ||
"field": "Anteil", | "field": "Anteil", | ||
− | "expr": "datum.AnzahlGestorben / datum. | + | "expr": "datum.AnzahlGestorben / datum.AnzahlKandidatInnen" |
− | },{ | + | }, |
+ | { | ||
"type": "formula", | "type": "formula", | ||
"expr": "format('.0%', datum.Anteil)", | "expr": "format('.0%', datum.Anteil)", | ||
Zeile 72: | Zeile 97: | ||
"type": "ordinal", | "type": "ordinal", | ||
"range": "width", | "range": "width", | ||
− | "domain": {"data": "table", "field": " | + | "domain": {"data": "table", "field": "AutorIn"} |
}, | }, | ||
{ | { | ||
Zeile 130: | Zeile 155: | ||
"properties": { | "properties": { | ||
"enter": { | "enter": { | ||
− | "x": {"scale": "x", "field": " | + | "x": {"scale": "x", "field": "AutorIn", "offset":10}, |
"width": {"scale": "x", "band": true, "offset": -20}, | "width": {"scale": "x", "band": true, "offset": -20}, | ||
"y": {"scale": "y","field": "Anteil"}, | "y": {"scale": "y","field": "Anteil"}, |
Version vom 4. Oktober 2017, 12:17 Uhr
Die Statistik über die Anzahl der verstorbenen KandidatInnen nach AutorInnen. Die zugrunde liegenden Daten können in der Daten-Vorlage angepasst werden