bootsoon / ng-circle-progress

A simple circle progress component created for Angular based on SVG Graphics.
https://bootsoon.github.io/ng-circle-progress/
MIT License
250 stars 85 forks source link

Start from number. #133

Closed belenofonte closed 3 years ago

belenofonte commented 3 years ago

Hi,

 It's possible to start from another value of percentage not zero (with other color), this maybe will allow to put in the same ng-circle more than one value over the 100% like donut chart graphic, different percentage on same circle.

Something to provide in array maybe.

[percent]=["30","20","10"] [outerStrokeWidth]=["10","10","10"] [outerStrokeColor]=["e6280f", "e6280f", "f08c00"] *Rest of properties.

Thanks for your help.

bootsoon commented 3 years ago
  ngCircleOptions = {
    percent: 85,
    ...
    subtitleFormat: (percent: number): string => {
      if (percent < 25) {
        this.ngCircleOptions.outerStrokeColor = "red";
      } else if (percent < 50) {
        this.ngCircleOptions.outerStrokeColor = "yellow";
      } else if (percent < 75) {
        this.ngCircleOptions.outerStrokeColor = "blue";
      } else {
        this.ngCircleOptions.outerStrokeColor = "green";
      }
      return '';
    }
  }
belenofonte commented 3 years ago

That's not works fine. Thanks. En lunes, 26 de octubre de 2020 16:46:30 CET, Boot Soon notifications@github.com escribió:

Closed #133.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.