User:Chenzw/Bot reports/Graph
< User:Chenzw | Bot reports
{
"width": 400,
"height": 250,
"padding": {"top": 10, "left": 30, "bottom": 30, "right": 10},
"data": [
{
"name": "table",
"values": [
{"x": "Mon", "y": {{{1}}}},
{"x": "Tue", "y": {{{2}}}},
{"x": "Wed", "y": {{{3}}}},
{"x": "Thu", "y": {{{4}}}},
{"x": "Fri", "y": {{{5}}}},
{"x": "Sat", "y": {{{6}}}},
{"x": "Sun", "y": {{{7}}}}
]
}
],
"scales": [
{
"name": "x",
"type": "ordinal",
"range": "width",
"domain": {"data": "table", "field": "x"}
},
{
"name": "y",
"type": "linear",
"range": "height",
"domain": {"data": "table", "field": "y"},
"nice": true
}
],
"axes": [
{"type": "x", "scale": "x"},
{"type": "y", "scale": "y"}
],
"marks": [
{
"type": "rect",
"from": {"data": "table"},
"properties": {
"enter": {
"x": {"scale": "x", "field": "x"},
"width": {"scale": "x", "band": true, "offset": -1},
"y": {"scale": "y", "field": "y"},
"y2": {"scale": "y", "value": 0}
},
"update": {
"fill": {"value": "steelblue"}
},
"hover": {
"fill": {"value": "red"}
}
}
},
{
"type": "text",
"from": {"data": "table"},
"properties": {
"enter": {
"x": {"scale": "x", "field": "x"},
"y": {"scale": "y", "field": "y"},
"text": {"field": "y"},
"align": {"value": "center"},
"baseline": {"value": "middle"},
"fontsize": {"value": 10},
"fill": {"value": "black"},
"dx": {"scale": "x", "band": true, "mult": 0.5},
"dy": {"value": -10}
}
}
}
]
}