Open alamsha opened 7 years ago
I had the same issue and solved it by wrapping type into {{}}. According to source code chart-type attribute handling differs from the one for chart-data and chart-options attributes. Directive scope is defined as follows:
scope: { data: '=chartData', options: '=chartOptions', type: '@chartType', ... }
Working code for me:
<canvas tc-chartjs chart-type="{{$ctrl.chartType}}" chart-data="$ctrl.chartData" chart-options="$ctrl.chartOptions"></canvas>
In the above code, chart type is not changing from the controller scope. But this works perfectly in angular-chartjs. How can i change the chart type dynamically by clicking a button?. Thanks.