0.0.3 • Published 4 years ago

@ng-library/circular-graphs v0.0.3

Weekly downloads
4
License
GNU 2
Repository
github
Last release
4 years ago

@ng-library/circular-graphs

Set of circular graphs for angular.

  • Radial Progress Bar graph
  • Doughnut graph

Table of Contents

Installation

Install @ng-library/circular-graphs

npm i @ng-library/circular-graphs --save

Documentation

Radial Progress Bar

npm.io npm.io

Params
paramtypedescription
valueintValue of progress bar. Must be between 0 and 100.
color ?stringColor of progress bar.
showValue ?stringShow the value in percentaje in center of progress bar.
Usage:
@ app.module.ts

...
import { RadialProgressBarModule } from '@angular-lib/circular-graphs'; 
...

@NgModule({
    ...
    imports: [
        ...
        RadialProgressBarModule
    ],
    ...
})
@ file.component.ts

...
ngOnInit() {
    this.RadialProgressData = {
        value: 48,
        color: 'blue'
        showValue: true
    };
}
...
@ file.html

<ngl-radial-progress-bar
    style="width: 200px; height: 100px; display: block;"
    [graphData]="RadialProgressData"
></ngl-radial-progress-bar>

Doughnt

npm.io npm.io npm.io

Params
paramtypedescription
valuesarrayArray of values to represent.
colors?arrayColor of segments of doughnt. If there isn't colors are applied random colors.
paddingbooleanDraw padding between doughnut segments.
labelsobject
labels.positionstringSet the position of labels. Allowed values are 'internal' or 'external'.
labels.titlesarrayArray of titles of labels
Usage:
@ app.module.ts

...
import { DoughnutModule } from '@angular-lib/circular-graphs'; 
...

@NgModule({
    ...
    imports: [
        ...
        DoughnutModule
    ],
    ...
})
@ file.component.ts

...
ngOnInit() {
    this.DoughnutData = {
        values: [32, 24, 21, 46],
        colors: ['red', 'blue', 'yellow', 'green']
    };
}
...
@ file.html

<ngl-doughnut
    style="width: 200px; height: 100px; display: block;"
    [graphData]="DoughnutData"
></nngl-doughnut>

License

GNU 2.0