Created
June 27, 2014 07:40
-
-
Save bettysteger/2b15e49b0ea69687be44 to your computer and use it in GitHub Desktop.
How-to create a simple pie chart with angular-nvd3
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<nvd3 options="pieOptions" data="pieData"></nvd3> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$scope.pieOptions = { | |
chart: { | |
type: 'pieChart', | |
height: 500, | |
x: function(d) { return d.key; }, | |
y: function(d) { return d.y; }, | |
showLabels: true | |
} | |
}; | |
$scope.pieData = [ | |
{ key: 'Apple', y: 75 }, | |
{ key: 'Oranges', y: 25 } | |
]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment