Solved

Implmenting Pie Charts in Angularjs

Posted on 2016-11-01
3
18 Views
Last Modified: 2016-11-07
How do you implement pie charts in angularjs.
0
Comment
Question by:Member_2_7967608
  • 2
3 Comments
 
LVL 51

Accepted Solution

by:
Julian Hansen earned 500 total points
ID: 41869705
You need a library to do this AngularJS does not natively support Pie Charts

A Google search should produce results on this.

I had a look at this one https://jtblin.github.io/angular-chart.js/

It appears to be well supported, is built for Angular and includes examples on how to create a Pie Chart.

From their sample page
HTML
<canvas id="pie" class="chart chart-pie"
  chart-data="data" chart-labels="labels" chart-options="options">
</canvas> 

Open in new window

JavaScript
angular.module("app", ["chart.js"]).controller("PieCtrl", function ($scope) {
  $scope.labels = ["Download Sales", "In-Store Sales", "Mail-Order Sales"];
  $scope.data = [300, 500, 100];
});

Open in new window

0
 

Author Comment

by:Member_2_7967608
ID: 41876939
Thanks
0
 
LVL 51

Expert Comment

by:Julian Hansen
ID: 41877009
You are welcome.
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Introduction JSON is an acronym for JavaScript Object Notation.  It is a text-string data transport mechanism, capable of representing simple or complex data structures in a consistent and easy-to-read manner.  Similar in concept to XML, but more e…
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now