By default I show a chart for monthly data in my view using chartkick and highcharts. i have already prepared a hash for showing yearly chart but how can I show show yearly chart on buttonclick. My html:
<div class="flot-chart">
<div class="flot-chart-content" id="flot-dashboard-chart">
<%= column_chart @chart_by_month ,height: "200px",width: "900px" %>
</div>
</div>
and the button I have added is only month. I will add a chart for yearly data, but how do I show it with button click?
<div class="btn-group">
<button type="button" id="by_month" class="btn btn-xs btn-white">Monthly</button>
</div>