[Chartjs]-Change Angular js charts.js chart type dynamically

4đź‘Ť

âś…

You have to use the “chart-type” directive to change the chart type dynamically. They already provide it out of the box.

Check this plunker: http://plnkr.co/edit/xKrCCcEQpzEvxfUMJKzd?p=preview

    <canvas id="bar" class="chart-base" chart-type="selectedType"
  chart-data="data" chart-labels="labels"> chart-series="series"
</canvas>

Reference : http://jtblin.github.io/angular-chart.js/#base-chart (search for “dynamic chart”)

Leave a comment