Skip to content

Instantly share code, notes, and snippets.

@clpo13
Last active May 25, 2021 16:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save clpo13/380b5c74b52d1eb56cba1183647e8de8 to your computer and use it in GitHub Desktop.
Save clpo13/380b5c74b52d1eb56cba1183647e8de8 to your computer and use it in GitHub Desktop.
{
"$schema": "https://vega.github.io/schema/vega/v4.json",
"width": 600,
"height": 300,
"padding": 5,
"title": "Number of re-education related government procurement bids in Xinjiang",
"data": [
{
"name": "table",
"values": [
{"month": "2016-04", "bids": 1},
{"month": "2016-05", "bids": 0},
{"month": "2016-06", "bids": 0},
{"month": "2016-07", "bids": 0},
{"month": "2016-08", "bids": 0},
{"month": "2016-09", "bids": 1},
{"month": "2016-10", "bids": 0},
{"month": "2016-11", "bids": 1},
{"month": "2016-12", "bids": 1},
{"month": "2017-01", "bids": 1},
{"month": "2017-02", "bids": 0},
{"month": "2017-03", "bids": 5},
{"month": "2017-04", "bids": 4},
{"month": "2017-05", "bids": 4},
{"month": "2017-06", "bids": 13},
{"month": "2017-07", "bids": 7},
{"month": "2017-08", "bids": 8},
{"month": "2017-09", "bids": 8},
{"month": "2017-10", "bids": 4},
{"month": "2017-11", "bids": 4},
{"month": "2017-12", "bids": 3},
{"month": "2018-01", "bids": 1},
{"month": "2018-02", "bids": 2},
{"month": "2018-03", "bids": 2},
{"month": "2018-04", "bids": 2},
{"month": "2018-05", "bids": 1}
]
}
],
"scales": [
{
"name": "xscale",
"type": "band",
"domain": {"data": "table", "field": "month"},
"range": "width",
"padding": 0.35,
"round": true
},
{
"name": "yscale",
"domain": {"data": "table", "field": "bids"},
"nice": true,
"range": "height"
}
],
"axes": [
{ "orient": "bottom", "scale": "xscale", "labelAngle": -45, "labelAlign": "right" },
{ "orient": "left", "scale": "yscale", "grid": true, "tickCount": 7 }
],
"marks": [
{
"type": "rect",
"from": {"data":"table"},
"encode": {
"enter": {
"x": {"scale": "xscale", "field": "month"},
"width": {"scale": "xscale", "band": 1},
"y": {"scale": "yscale", "field": "bids"},
"y2": {"scale": "yscale", "value": 0}
},
"update": {
"fill": {"value": "steelblue"}
}
}
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment