ng-canvas-gauge is an Angular component for creating a customizable gauge with a 270-degree scale.
- Display values on a 270-degree circular scale.
- Customizable ticks and colors.
- Animated needle movement.
-
Install the ng-canvas-gauge component:
npm install ng-canvas-gauge
-
Import the NgCanvasGaugeComponent in your Angular module:
import { NgCanvasGaugeComponent } from 'ng-canvas-gauge'; // ... @NgModule({ declarations: [ NgCanvasGaugeComponent, // ... ], // ... }) export class YourModule { }
-
Use the ng-canvas-gauge component in your template:
<ng-canvas-gauge
[value]="yourValue"
[max]="yourMaxValue"
[radius]="120"
[width]="400"
[height]="400"
[ticks]="yourNumberOfTicks">
</ng-canvas-gauge>
Replace yourValue, yourMaxValue, and yourNumberOfTicks with your desired values.
- value: The current value to be displayed on the gauge.
- max: The maximum value of the gauge scale.
- ticks: The number of ticks to be displayed on the gauge.
- radius : the gauge radius ( default is 80)
- width : width of the canvas (default is 200)
- height : height of the canvas ( default is 200)