question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

how to use ng-circle-progress src code in an angular project?

See original GitHub issue

I’m using angular 6 and I want to use ng-circle-progress. I implemented the circles but I want to change something that I think I should do it from the src code. there is a units and title options in the circles and I want them to get closer to each other. How can I do it?

app.module.ts

import {
  NgCircleProgressModule
} from 'ng-circle-progress';

imports: [
  CommonModule,
  RouterModule.forChild(HomeRoutingModule),
  NgCircleProgressModule.forRoot({
    "units": "Liter",
    "outerStrokeLinecap": "butt"
  })
]

home.component.html <circle-progress [percent]="65" [radius]="100" [outerStrokeWidth]="8" [innerStrokeWidth]="2" [outerStrokeColor]=tank.outerColor [innerStrokeColor]="'#e2e2e2'" [animation]="true" [animationDuration]="300" [space]="5" [showSubtitle]= "false" [showUnits]= "true" [unitsFontSize]= "15" [titleFontSize]= "45" [clockwise]= "false"> </circle-progress>

and this is the image of output. how can I control the space between 65 and liter?

untitled55

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
faribajprcommented, Sep 1, 2018

@bootsoon I solved it, I should put CircleProgressOptions in providers list in app.module! thanks for your helps!

0reactions
dhair-sevacommented, Jan 9, 2020

Hope this helps someone in the future.

With this type of library, manually importing a provider isn’t best since the library should expose it. After looking into the module, it looks like CircleProgressOptions is only exposed if you add the forRoot() in your module.

See code below:

  static forRoot(options: CircleProgressOptionsInterface = {}): ModuleWithProviders {
    return {
      ngModule: NgCircleProgressModule,
      providers: [
        {provide: CircleProgressOptions, useValue: options}
      ]
    };
  }

After doing this, it fixed it on my end.

So in my module, I had this in my list of imports:

NgCircleProgressModule.forRoot(),
Read more comments on GitHub >

github_iconTop Results From Across the Web

how to use ng-circle-progress src code in an angular project?
To control space between the outer and inner circles, tweak the 'space' option. If you want to reduce the space between the circles,...
Read more >
ng-circle-progress - npm
Start using ng-circle-progress in your project by running `npm i ng-circle-progress`. There are 12 other projects in the npm registry using ...
Read more >
15th March Progress - HackMD
Inside project, install Angular and NgCircleProgress module; Code in home.page.html, home.page.ts, and other needed; Launch locally using “ionic serve” ...
Read more >
ng-circle-progress-quadrants - npm package - Snyk
[Try out the demo!](https://bootsoon.github.io/ng-circle-progress/) For more information about how to use this package see README.
Read more >
ng-circle-progress demo
NgCircleProgress Demo. A simple circle progress component created for Angular based on SVG Graphics. View on GitHub. 85 % progress 50 Point 99.99...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found