Created
June 9, 2020 15:22
-
-
Save bkamapantula/491601b6924878472f3eae83b2a14870 to your computer and use it in GitHub Desktop.
Created with Gramex Charts. Visit at https://gramener.com/gramexcharts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"category": "cat1", | |
"value": 15 | |
}, | |
{ | |
"category": "cat2", | |
"value": 85 | |
}, | |
{ | |
"category": "cat3", | |
"value": 62 | |
}, | |
{ | |
"category": "cat4", | |
"value": 54 | |
} | |
] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
data = { | |
// JSON or a CSV endpoint | |
url: "https://gist.githubusercontent.com/LakshmiVSeelam/9f8dedc6018457c40e91cac9009e0951/raw/a7d3b580bb01d5770f1806c12e05179f5ee7b02e/horz_bar_data.json" | |
} | |
function draw(data, el, opts) { | |
base_spec = "https://gist.githubusercontent.com/LakshmiVSeelam/8061a0e1a5a948f3f0611835da8ae093/raw/bfdaf46b986214b7b1b368c24363665b530d0283/horz_bar_config.json" | |
$.getJSON(base_spec, function(spec) { | |
new vega.View(vega.parse(spec)) | |
.renderer('svg') | |
.tooltip(new vegaTooltip.Handler().call) | |
.logLevel(vega.Warn) | |
.initialize(el) | |
.hover() | |
.run() | |
}) | |
} | |
scripts = [ | |
"https://unpkg.com/[email protected]/build/vega.min.js", | |
"https://unpkg.com/[email protected]/build/vega-tooltip.min.js" | |
] | |
options = { | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment