Created
May 10, 2017 22:29
-
-
Save stphnwlkr/32c1a6269cec4b0a9fc4b9dcfda3428c to your computer and use it in GitHub Desktop.
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
<div class="input-group input-group-lg"> | |
<label for="cts" class="sr-only"><i class='fa fa-signal'></i> Chart Type</label> | |
<span class="input-group-addon sr-hidden"><i class='fa fa-signal'></i> Chart Type</span> | |
<select id="cts" class="form-control" > | |
<option value="bar">Bar</option> | |
<option value="hbar">Horizontal Bar</option> | |
<option value="pie">Pie</option> | |
<option value="bar3d">3D Bar</option> | |
<option value="hbar3d">3D Horizontal Bar</option> | |
</select> | |
</div> | |
<hr> | |
<div id="countrychart"></div> | |
<script> | |
//initial load | |
zingchart.render({ | |
dataurl: '#application.demoroot#/_pods/charts/bar/countrychartData.cfm', | |
width: '100%', | |
height: 450, | |
output:"svg", | |
container: 'countrychart' | |
}); | |
//on change | |
$("##cts").change(function(){ | |
var data = $(this).val(); | |
zingchart.render({ | |
dataurl: '#application.demoroot#/_pods/charts/bar/countrychartData.cfm?ct='+data, | |
width: '100%', | |
height: 550, | |
output:"svg", | |
container: 'countrychart' | |
}); | |
}); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment