Pie chart in AngularJS using ChartJS

Pie chart in AngularJS using ChartJS

A set of data are better understood when represented graphically, there are various ways to represent data, out which Pie 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. Doughnut 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 Pie chart:

Let’s see the implementation of Pie Chart:




Pie Chart

We can clearly see how a Pie chart is rendered. 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 *