Skip to content

Instantly share code, notes, and snippets.

@bettysteger
Created June 27, 2014 07:40
Show Gist options
  • Save bettysteger/2b15e49b0ea69687be44 to your computer and use it in GitHub Desktop.
Save bettysteger/2b15e49b0ea69687be44 to your computer and use it in GitHub Desktop.
How-to create a simple pie chart with angular-nvd3
<nvd3 options="pieOptions" data="pieData"></nvd3>
$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