Vorlage:Graph:Todesursachen: Unterschied zwischen den Versionen
Zur Navigation springen
Zur Suche springen
Void (Diskussion | Beiträge) (Seite neu angelegt) |
Void (Diskussion | Beiträge) K (Datumskonvertierung korrigiert) |
||
| (7 dazwischenliegende Versionen desselben Benutzers werden nicht angezeigt) | |||
| Zeile 8: | Zeile 8: | ||
"width": {{{width|600}}}, | "width": {{{width|600}}}, | ||
"height": {{{height|300}}}, | "height": {{{height|300}}}, | ||
| − | "padding": {"top": 20, "left": 70, "bottom": | + | "padding": {"top": 20, "left": 70, "bottom": 50, "right": 70}, |
"data": [ | "data": [ | ||
{ | { | ||
| − | "name": " | + | "name": "sub", |
"values": {{Data:Folgen}}, | "values": {{Data:Folgen}}, | ||
| − | "transform": [{ | + | "transform": [ |
| − | "type": " | + | { |
| − | " | + | "type": "formula", |
| − | },{ | + | "field": "Datum", |
| + | "expr": "datetime(substring(datum.Datum,6,10), substring(datum.Datum,3,5)-1, substring(datum.Datum,0,2))" | ||
| + | }, | ||
| + | { | ||
"type": "aggregate", | "type": "aggregate", | ||
| − | |||
"summarize": [{ | "summarize": [{ | ||
| − | "field": " | + | "field": "Datum", |
| − | "ops": [" | + | "ops": ["max"], |
| − | "as": [" | + | "as": ["Stand"] |
}] | }] | ||
| + | } | ||
| + | ] | ||
| + | },{ | ||
| + | "name": "table", | ||
| + | "values": {{Data:Folgen}}, | ||
| + | "transform": [ | ||
| + | { | ||
| + | "type": "formula", | ||
| + | "field": "Eins", | ||
| + | "expr": "1" | ||
| + | }, | ||
| + | { | ||
| + | "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": "filter", | ||
| + | "test": "datum.value.Gestorben" | ||
| + | }, | ||
| + | { | ||
| + | "type": "formula", | ||
| + | "field": "Ursache", | ||
| + | "expr": "datum.value.Todesursache" | ||
| + | }, | ||
| + | { | ||
| + | "type": "aggregate", | ||
| + | "groupby": ["Ursache"], | ||
| + | "summarize": [{ | ||
| + | "field": "Eins", | ||
| + | "ops": ["sum"], | ||
| + | "as": ["Anzahl"] | ||
| + | } | ||
| + | ] | ||
}] | }] | ||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
} | } | ||
], | ], | ||
| Zeile 42: | Zeile 71: | ||
"type": "ordinal", | "type": "ordinal", | ||
"range": "width", | "range": "width", | ||
| − | "domain": {"data": "table", "field": " | + | "domain": {"data": "table", "field": "Ursache"} |
}, | }, | ||
{ | { | ||
| Zeile 50: | Zeile 79: | ||
"domain": {"data": "table", "field": "Anzahl"}, | "domain": {"data": "table", "field": "Anzahl"}, | ||
"nice": true | "nice": true | ||
| + | }, | ||
| + | { | ||
| + | "name": "sub", | ||
| + | "type": "ordinal", | ||
| + | "range": "width", | ||
| + | "domain": {"data": "sub", "field": "Stand"} | ||
} | } | ||
], | ], | ||
| Zeile 63: | Zeile 98: | ||
"scale": "y", | "scale": "y", | ||
"title": "Anzahl", | "title": "Anzahl", | ||
| + | "ticks": {{{ticksY|5}}}, | ||
"properties": { | "properties": { | ||
"labels": { | "labels": { | ||
| Zeile 68: | Zeile 104: | ||
}, | }, | ||
"title": {"fontSize": {"value": {{{fontSize|14}}} } } | "title": {"fontSize": {"value": {{{fontSize|14}}} } } | ||
| + | } | ||
| + | }, | ||
| + | { | ||
| + | "type": "x", | ||
| + | "scale": "sub", | ||
| + | "tickSize": 0, | ||
| + | "properties": { | ||
| + | "labels": { | ||
| + | "text": {"template": "#puertoStatistiko \u007b{datum.data{{!}}time:'%Y'}\u007d"}, | ||
| + | "fontSize": {"value": {{{fontSize|14}}} }, | ||
| + | "dx": {"value": {{{width|600}}}, "mult": -0.4}, | ||
| + | "dy": {"value": {{{fontSize|14}}}, "mult": 2} | ||
| + | }, | ||
| + | "axis": { | ||
| + | "strokeOpacity": {"value": 0} | ||
| + | } | ||
| + | } | ||
| + | }, | ||
| + | { | ||
| + | "type": "x", | ||
| + | "scale": "sub", | ||
| + | "tickSize": 0, | ||
| + | "properties": { | ||
| + | "labels": { | ||
| + | "text": {"template": "Stand: \u007b{datum.data{{!}}time:'%d.%m.%Y'}\u007d"}, | ||
| + | "fontSize": {"value": {{{fontSize|14}}} }, | ||
| + | "dx": {"value": {{{width|600}}}, "mult": 0.4}, | ||
| + | "dy": {"value": {{{fontSize|14}}}, "mult": 2}, | ||
| + | }, | ||
| + | "axis": { | ||
| + | "strokeOpacity": {"value": 0} | ||
| + | } | ||
} | } | ||
} | } | ||
| Zeile 77: | Zeile 145: | ||
"properties": { | "properties": { | ||
"enter": { | "enter": { | ||
| − | "x": {"scale": "x", "field": " | + | "x": {"scale": "x", "field": "Ursache", "offset":10}, |
| − | "width": {"scale": "x", "band": true, "offset": - | + | "width": {"scale": "x", "band": true, "offset": -20}, |
"y": {"scale": "y","field": "Anzahl"}, | "y": {"scale": "y","field": "Anzahl"}, | ||
"y2": {"scale": "y","value": 0}, | "y2": {"scale": "y","value": 0}, | ||
| Zeile 95: | Zeile 163: | ||
{ | { | ||
"type": "text", | "type": "text", | ||
| + | "from": {"data": "table"}, | ||
"properties": { | "properties": { | ||
"enter": { | "enter": { | ||
"align": {"value": "center"}, | "align": {"value": "center"}, | ||
| − | "fill": {"value": "#333" | + | "fill": {"value": "#333"}, |
| − | + | "x": {"scale": "x", "field": "Ursache"}, | |
| − | |||
| − | "x": {"scale": "x", " | ||
"dx": {"scale": "x", "band": true, "mult": 0.5}, | "dx": {"scale": "x", "band": true, "mult": 0.5}, | ||
| − | "y": {"scale": "y", " | + | "y": {"scale": "y", "field": "Anzahl", "offset": -5}, |
| − | "text": {" | + | "text": {"field": "Anzahl"}, |
"fontSize": {"value": {{{fontSize|14}}} }, | "fontSize": {"value": {{{fontSize|14}}} }, | ||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
} | } | ||
} | } | ||
Aktuelle Version vom 15. Oktober 2017, 14:50 Uhr
Die Statistik über die Häufigkeit unterschiedlicher Todesursachen. Die zugrunde liegenden Daten können in der Daten-Vorlage angepasst werden