carlcraig / tc-angular-chartjs

AngularJS directives for Chart.js
http://carlcraig.github.io/tc-angular-chartjs/
Other
233 stars 83 forks source link

ng-show ng-hide not working properly #41

Closed vishnukarthikl closed 9 years ago

vishnukarthikl commented 9 years ago

I have a div which encloses a chart which has ng-show property on it.

<button ng-click="showGraph=!showGraph" ng-init="showGraph=false">toggle</button>
<div ng-show="showGraph">
  <canvas tc-chartjs-bar chart-data="data"></canvas>
</div>

But when showGraph property is changed to true, the div becomes visible but the graph is not rendered. But where as if ng-init="showGraph=true" is set then the chart is rendered properly first and the subsequent toggle work fine. I also checked the same for pie chart and ng-show/hide is working fine.

carlcraig commented 9 years ago

This is linked to #9, the current solution is to use ng-if instead until we find a fix for this issue