0.0.2 • Published 6 years ago

mgx-circular-progress-bar v0.0.2

Weekly downloads
23
License
MIT
Repository
github
Last release
6 years ago

MgxCircularProgressBar

Description:

A library for circular progress bars components, an elegant way to rappresent your percentages.

Demo

this Demo has different combinations of progress bars, choose your favorite one!

Also check this github page to find all original code or open issues MgxCircularProgressBar.

Installation:

  npm install mgx-circular-progress-bar --save

Import and usage

include mgx-circular-progress module in your project, for example if you want to add it to your app module:

App Module

import { BrowserModule } from '@angular/platform-browser';
import { AppComponent } from './app.component';
import { MgxCircularProgressModule } from 'mgx-circular-progress-bar';
//or in alternative
import { MgxCircularProgressBarModule, 
MgxCircularProgressFullBarModule, 
MgxCircularProgressPieModule } from'mgx-circular-progress-bar';

@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    BrowserModule,
    MgxCircularProgressModule
    //or in alternative
    MgxCircularProgressBarModule,
    MgxCircularProgressFullBarModule,
    MgxCircularProgressPieModule 
  ],
  providers: [],
  bootstrap: [AppComponent]
})
export class AppModule { }

Basic usage:

mgx-circular-progress-bar

 <mgx-circular-progress-bar percentage="20"></mgx-circular-progress-bar>

mgx-circular-progress-full-bar

 <mgx-circular-progress-full-bar percentage="20"></mgx-circular-progress-full-bar>

mgx-circular-progress-pie

 <mgx-circular-progress-pie percentage="20"></mgx-circular-progress-pie>

Main configurations

attributevalue expectedmeaning
percentagefrom 0 to 100percentage already calculated
totalany numberin combination with barValue calculate the percentage, must be >= than barValue
barValueany numberis the value of the progress bar, the percentage is calculated in relation to the total, must be <= to the total
diameterany numbernumber of pixels to establish the total size of the circumference
fontSizeany numberoverride default font-size style of percentage value, is defined in pixels
colorHEX valuebar/pie/full-bar color; example: #e22525 default color: #3282b8
bgColorHEX valuebar/pie/full-bar background color; example: #e0e0e0 default color: #eee
contentTemplateTemplateRefallows you to overwrite the default percentage with a new template, to use it you need to pass the reference of a template through its selector #tlpName to this attribute, in alternative you can pass your content directly inside tags, see the Demo for examples

Full-Bar configurations

all the main ones plus the following

attributevalue expectedmeaning
contentSizefrom 20 to 83value to define the size of background circle, default: 83
pathPositionfrom 20 to 90value to define a new bar position, default: 90

Pie configurations

all the main ones plus the following

attributevalue expectedmeaning
bgSizefrom 0 to 10value to define the size of background circle, default: 10