Doughnut Chart in AngularJS using ChartJS

Doughnut Chart in AngularJS using ChartJS

A set of data are better understood when represented graphically, there are various ways to represent data, out which Doughnut Chart is one of them. The chart can be implemented using AngularJS.

AngularJS uses Chart.js as a dependency to create given chart, which imparts responsiveness and provides various other flexibility, which we’ll see them going further. Other implementation of Chart are

  1. Pie Chart
  2. Bar Chart
  3. Horizontal Bar Chart
  4. Line Chart

Environment Set:


  1. angular.min.js
  2. angular-chart.min.js
  3. chart.js

These files need to be included in page as-

After including the files in page, one must add chart.js in module dependency, as shown below

Directives of AngularJS charts:

[table “” not found /]

Implementation of Doughnut Chart:

Let’s see the implementation of Doughnut Chart:





Doughnut Chart

We can clearly see how a doughnut chart is rendered with single and double data sets. Depending upon requirement we can make successive changes. There are few thing one should keep note while making changes

  • chart-colors: This directive is not mandatory, when removed a color is automatically assigned to each section. However if used then one need to ensure to use only color code but not names.

Stay tuned for more updates!

Leave a Reply

Your email address will not be published. Required fields are marked *