I've created few graphs using the dc.js
. Everything runs very smooth.
But the problem is when I try to add reset
button for some reason it's not working.
Below is the anchor tag I'm using to reset the graph.
<a class="reset" href="javascript:Chart1.filterAll();dc.redrawAll();" style="display: none;">reset</a>
Someone help me if i'm missing anything. I couldn't get any documentation of the reset stuff.
The problem was that you were defining your chart variable inside the local scope of the Javascript code executed at the beginning. This means that it wasn't accessible from the scope of the button Javascript, which generated an error.
To fix, simply remove the var
from the definition of the chart variable. Complete example here.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With