I have an alchemy graph displayed.
new Alchemy(config);
How can I change the config.dataSource and then redisplay the graph with the new data?
I have an alchemy graph displayed.
new Alchemy(config);
How can I change the config.dataSource and then redisplay the graph with the new data?
You could create an new configuration and then reload it in javascript. Something like this:
<script type="javascript">
var config = {
dataSource: "data/data.json",
...
...
}
var newConfig = {
dataSource: "data/new_data.json",
...
...
}
function changeData(){
alchemy = new Alchemy(newconfig);
}
</script>
<body>
<button onclick="changeData()">Click me</button>
</body>