
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
org.webjars.bower:n3-charts.pie-chart
Advanced tools
Yummy pies and donuts for AngularJS applications. Built on top of the wonderful D3.js library.
Here is a demo page.
pie-chart.min.js
wherever you wantA pie chart is called using this syntax :
<pie-chart data="data" options="options"></pie-chart>
The pie chart directives needs two attributes : data
and options
. If one is missing, nothing happens.
Your data be an array. Depending whether you wan a pie/dout or a gauge, the array can contain at least two rows, or only one.
$scope.data = [
{label: "one", value: 12.2, color: "red"},
{label: "two", value: 45, color: "#00ff00"},
{label: "three", value: 10, color: "rgb(0, 0, 255)"}
];
$scope.gauge_data = [
{label: "CPU", value: 75, suffix: "%", color: "steelblue"}
];
Options must be an object. Depending whether you want a pie/donut or a gauge, additional settings can be required.
$scope.options = {thickness: 10};
thickness
: optional (default is 10). Defines the chart's thickness and has an impact on the legend display (thicker chart means less space for legend).$scope.gauge_options = {thickness: 5, mode: "gauge", total: 100};
thickness
: optional (default is 10). Defines the chart's thickness and has an impact on the legend display (thicker chart means less space for legend).mode
: optional (default is ""). Can be "gauge" or anything else (but anything else will default to standard pie/donut mode). "gauge" only works when there is exactly one data row in the chart's data
attribute.total
: optional (default is 100). Ignored if mode
is not "gauge". Make the chart able to display the data relatively to a maximum (for instance, if you want to display a percentage, the maximum should be 100).Fetch the repo :
$ git clone https://github.com/angular-d3/pie-chart.git
Install stuff :
$ npm install
Install moar stuff :
$ bower install
Install teh uterz stuff :
$ grunt
Hack.
AngularJS is designed to be testable, and so is this project. It has a good coverage rate (between 85% and 95%), and we want to keep it this way.
FAQs
WebJar for pie-chart
We found that org.webjars.bower:n3-charts.pie-chart demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.