Benutzer:2804/dpg
aus Wikipedia, der freien Enzyklopädie
< Benutzer:2804
Dies ist die aktuelle Version dieser Seite, zuletzt bearbeitet am 20. Januar 2019 um 14:36 Uhr durch imported>2804(2886887) (33).
<graph> {
// // ATTENTION: This code is maintained at https://www.mediawiki.org/wiki/Template:Graph:Stacked // Please do not modify it anywhere else, as it may get copied and override your changes. // Suggestions can be made at https://www.mediawiki.org/wiki/Template:Graph:Stacked // // Template translation is in https://commons.wikimedia.org/wiki/Data:Original/Template:Graphs.tab //
"version": 2, "width": 550, "height": 250,
"data": [{ "name": "chart",
"url": "tabular:///Test",
"format": {"type": "json"
, "property": "data"
}, "transform": [ // Convert xField parameter into a field "_xfield" {"type": "formula", "field": "_xfield", "expr":
"datum.Zuhörer"
}, {"type": "sort", "by": ["_xfield"]},
// For non-bar graph, ensure that all missing values still present as zeros to avoid area breaks // We might need to allow other, non-0 values to be imputed.
{
"type": "impute", "groupby": ["key"], "orderby": ["_xfield"], "field": "value", "method": "value", "value": 0 }, ] },
{ "name": "stats", "source": "chart", "transform": [{ "type": "aggregate", "groupby": ["_xfield"], "summarize": [{"field": "value", "ops": ["sum"]}] }] } ], "scales": [ { "name": "x", "type": "Jahr", "domain": {"data": "chart", "field": "_xfield"},
"range": "width",
}, { "name": "y", "type": "linear", "range": "height", "domain": {"data": "stats", "field": "sum_value"},
}, { "name": "color", "type": "ordinal", "domain": {"data": "chart", "field": "key"}, "range": "category10" },
],
"axes": [ {"scale": "x", "type": "x", "tickSizeEnd": 0
, "ticks": 7
},
{"scale": "y", "type": "y", "tickSizeEnd": 0
// When drawing "type=year" bars with the given width, shift y axis left by half the width
}
],
"marks": [ // Group data by the "key", and draw lines, one line per key {
"type": "group",
"from": { "data": "chart", "transform": [ {"type": "stack", "groupby": ["_xfield"], "sortby": ["key"], "field": "value"}, {"type": "facet", "groupby": ["key"]} ] }, "marks": [ { "type": "area", "properties": { "enter": { "x": {"scale": "x", "field": "_xfield"}, "y": {"scale": "y", "field": "layout_start"}, "y2": {"scale": "y", "field": "layout_end"}, "fill": {"scale": "color", "field": "key"}, "interpolate": {"value": "monotone"} } } } ], }
]
} </graph> Rohdaten anzeigen oder bearbeiten.