Skip to content

Instantly share code, notes, and snippets.

@keizer619
Created December 3, 2015 06:48
Show Gist options
  • Save keizer619/cc817756e052aad3bea1 to your computer and use it in GitHub Desktop.
Save keizer619/cc817756e052aad3bea1 to your computer and use it in GitHub Desktop.
{
"width": 500,
"height": 200,
"padding": {"top": 10, "left": 30, "bottom": 30, "right": 10},
"data": [
{
"name": "table",
"values": [
{"x": 1, "y": 28, "z" : 13}, {"x": 2, "y": 55, "z" : 21},
{"x": 3, "y": 43, "z" : 52}, {"x": 4, "y": 91, "z" : 12}
]
}
],
"scales": [
{
"name": "x",
"type": "linear",
"range": "width",
"zero": false,
"domain": {"data": "table", "field": "x"}
},
{
"name": "y",
"type": "linear",
"range": "height",
"nice": true,
"domain": {"data": "table", "field": ["y","z"]}
}
],
"axes": [
{"type": "x", "scale": "x", "ticks": 20},
{"type": "y", "scale": "y"}
],
"marks": [
{
"type": "line",
"from": {"data": "table"},
"properties": {
"enter": {
"interpolate": {"value": "monotone"},
"x": {"scale": "x", "field": "x"},
"y": {"scale": "y", "field": "y"},
"y2": {"scale": "y", "value": 0},
"stroke": { "value": "orange"}
},
"update": {
"fillOpacity": {"value": 1}
},
"hover": {
"fillOpacity": {"value": 0.5}
}
}
},
{
"type": "rect",
"from": {"data": "table"},
"properties": {
"enter": {
"x": {"scale": "x", "field": "x"},
"width": {"value": 12},
"y": {"scale": "y", "field": "z"},
"y2": {"scale": "y", "value": 0},
"fill": {"value": "steelblue"}
}
}
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment