ngx-doughnut-chart
TypeScript icon, indicating that this package has built-in type declarations

0.0.4 • Public • Published

ngx-doughnut-chart

ngx-doughnut-chart is a light weight with no dependencies angular component to draw donut charts using svgs.

Installation

All you need to do is to run the following command:

$ npm i ngx-doughnut-chart --save

or

$ yarn add ngx-doughnut-chart --save

Usage

Import NgxDonutChartModule module into your main module and add it to imports:

import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
 
import { AppComponent } from './app.component';
 
import { NgxDonutChartModule } from 'ngx-doughnut-chart';
 
@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    BrowserModule,
    NgxDonutChartModule
  ],
  providers: [],
  bootstrap: [AppComponent]
})
export class AppModule { }
...
 
Pass data like this:
 
```typescript
 
donutChartData = [
  {
    label: 'Liverpool FC',
    value: 5,
    color: 'red',
  },
  {
    label: 'Real Madrid ',
    value: 13,
    color: 'black',
  },
  {
    label: 'FC Bayern München',
    value: 5,
    color: 'blue',
  },
];
 

and then use the component in your html like:

<ngx-donut-chart
  [data]="donutChartData"
  [title]="'Sessions'"
  [radius]="88"
  [thickness]="10"
  [margin]="30">
</ngx-donut-chart>

License

MIT © ahmedbassell

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.0.4
    90
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.0.4
    90
  • 0.0.3
    0
  • 0.0.2
    1
  • 0.0.1
    0

Package Sidebar

Install

npm i ngx-doughnut-chart

Weekly Downloads

91

Version

0.0.4

License

none

Unpacked Size

199 kB

Total Files

26

Last publish

Collaborators

  • bassell