I have tied this jQuery Bar Graph plugin with a function that I created.
My code is on fiddle here
http://jsfiddle.net/swordfish0321/9Rkc2/3/
Problem:
If the ‘Calculate’ button is clicked more that once it stacks text on top of itself rendering the graph non-useable. I tried inserting a reset button that successfully resets the form data and attempts to reset the bar graph, but really just performs a show and hide and the problem persists.
Question:
Anyone have any ideas of how I could either reset this calculator without a page refresh and/or incorporate the reset functionality into the ‘Calculate” button after it’s fired once?
Cheers.
You’re trying to run
.reset()on a DIV element. This will only work for forms.What you want todo is really just remove the charts when a user clicks reset. You can do this like:
$('#chart').empty();