Home

Awesome

CircleProgress

This project was generated with angular-cli version 1.0.0-beta.11-webpack.2.

Demo

About

It is a simple circle progress component created for Angualar2. When it was creating Angular2 was in RC5 version. Component is based only on SVG Graphics and has various of options to customize it.

Options

OptionTypeDefaultDescriptionExample
percentnumber0Number of percent you want to show[percent]="20"
boxSizenumber200Size of whole svg element[boxSize]="300"
radiusnumber180Radius od circle[radius]="90"
timenumber0Time in sec for progress animation[time]="2"
bordernumber20Width of circle[border]="30"
colorstring'green'Color of progress circle[color] = "'blue'"
backgroundColorstring'white'Color of rest of the circle[backgroundColor] = "'purple'"
lowColorstringsame os color optionColor for percent from 0%->25%[lowColor]="'red'"
middleColorstringlook aboveColor for percent from 26%->50%[lowColor]="'orange'"
interColorstringlook aboveColor for percent from 51%->75%[lowColor]="'yellow'"
highColorstringlook aboveColor for percent from 76%->100%[lowColor]="'green'"
fontColorstringblackColor of font inside circle[fontColor]="'grey'"
fontSizenumber12Size font inside circle[fontSize]="20"
fontFamilystring'Times New Roman'Family of font inside circle[fontColor]="'Arial'"
fontXstring'50%'X position of text inside in circle[fontX]="'20%'"
fontYstring'55%'Y position of text inside in circle[fontY]="'60%'"
textAnchorstring'middle'Align of text. Possible values(start, middle, end)[textAnchor]="'end'"
innerFillstring'white'Color of inner circle[fontY]="'pink'"

Animation

To start progress animation you have to call function animate() on component.

Example

<circle-progress #circleProg1
                   [percent]="25"
                   [boxSize]="400"
                   [radius]="140"
                   [lowColor]="'red'"
                   [middleColor]="'orange'"
                   [interColor]="'#f1c40f'"
                   [highColor]="'#16a085'"
                   [border]="20"
                   [time]="5"
                   (click)="circleProg1.animate()"
  ></circle-progress>