{"id":15618034,"url":"https://github.com/ashish-chopra/ngx-gauge","last_synced_at":"2026-02-09T10:05:31.262Z","repository":{"id":20401068,"uuid":"89837477","full_name":"ashish-chopra/ngx-gauge","owner":"ashish-chopra","description":"A highly customizable Gauge component for Angular apps and dashboards","archived":false,"fork":false,"pushed_at":"2025-01-21T19:41:12.000Z","size":2632,"stargazers_count":219,"open_issues_count":27,"forks_count":74,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-04-14T05:55:23.768Z","etag":null,"topics":["angular","angular14","arc","canvas","dashboard","dashboards","data-visualization","gauge","gauge-chart","gauge-component","ivy","meter","speedometer","threshold"],"latest_commit_sha":null,"homepage":"https://ashish-chopra.github.io/ngx-gauge","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ashish-chopra.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-04-30T07:53:29.000Z","updated_at":"2025-02-19T16:20:41.000Z","dependencies_parsed_at":"2024-10-30T15:04:26.355Z","dependency_job_id":"df4ebcf6-ab78-4514-85f9-1be46b60838e","html_url":"https://github.com/ashish-chopra/ngx-gauge","commit_stats":{"total_commits":102,"total_committers":9,"mean_commits":"11.333333333333334","dds":"0.22549019607843135","last_synced_commit":"0ee92d13f53f92b989a268d7cd16f9ba6e7e8299"},"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ashish-chopra%2Fngx-gauge","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ashish-chopra%2Fngx-gauge/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ashish-chopra%2Fngx-gauge/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ashish-chopra%2Fngx-gauge/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ashish-chopra","download_url":"https://codeload.github.com/ashish-chopra/ngx-gauge/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254259324,"owners_count":22040812,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["angular","angular14","arc","canvas","dashboard","dashboards","data-visualization","gauge","gauge-chart","gauge-component","ivy","meter","speedometer","threshold"],"created_at":"2024-10-03T08:00:54.650Z","updated_at":"2026-02-09T10:05:31.250Z","avatar_url":"https://github.com/ashish-chopra.png","language":"TypeScript","funding_links":[],"categories":["Recently Updated","Third Party Components"],"sub_categories":["[Oct 01, 2024](/content/2024/10/01/README.md)","Visual Effects"],"readme":"# ngx-gauge\n\u003c!-- [![Build Status](https://travis-ci.org/ashish-chopra/ngx-gauge.png?branch=master)](https://travis-ci.org/ashish-chopra/ngx-gauge) --\u003e\n![npm](https://img.shields.io/npm/v/ngx-gauge)\n![npm](https://img.shields.io/npm/dm/ngx-gauge)\n[![contributions welcome](https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat)](https://github.com/ashish-chopra/ngx-gauge/issues)\n![NPM](https://img.shields.io/npm/l/ngx-gauge)\n\nA highly customizable Gauge component for **Angular** apps and dashboards. It provides many configurationable options to customize according to your needs. Checkout the live demo [here](https://ashish-chopra.github.io/ngx-gauge). (For older versions of Angular, check out the [compatibility matrix](#compatibility) below).\n\n![alt text](https://raw.githubusercontent.com/ashish-chopra/angular-gauge/master/examples/examples.png)\n\nIn version `v5.0.0`, we introduced markers, ticks and background opacity for gauge as shown below. Checkout the documentation below.\n\u003cimg src=\"https://raw.githubusercontent.com/ashish-chopra/ashish-chopra.github.io/master/src/assets/demo2.png\" alt=\"markers demo\" width=\"300px\" /\u003e\n\u003cimg src=\"https://raw.githubusercontent.com/ashish-chopra/ashish-chopra.github.io/master/src/assets/demo1.png\" alt=\"markers demo\" width=\"300px\" /\u003e\n\n# Getting Started\n\n#### \u003ca name=\"compatibility\"\u003e\u003c/a\u003eAngular Version Compatibility Table\n\n| Angular Version | ngx-gauge Version |\n|--- |--- |\n|6.0 | - |\n|7.0 | - |\n|8.0| 1.0.0-beta.12 |\n|9.0 | 1.1.0 |\n|10.x.x | 2.0.0 |\n|11.x.x | 3.0.0 |\n|12.x.x | 4.0.0 |\n|13.x.x | 5.0.0 |\n|14.x.x | 6.0.0 |\n|15.x.x | 7.0.0 |\n|16.x.x | 8.0.0 |\n|17.x.x | 9.0.0 |\n|18.x.x | 10.0.0 |\n|19.x.x | 11.0.0 |\n|20.x.x | 12.0.0 |\n|21.x.x | 13.0.0 |\n\n#### Step 1: Install npm module\n\nFor latest version use the command:\n\n```bash\nnpm install ngx-gauge\n```\n\nFor a specific version for an older Angular version as per [Compatibility table](#compatibility) above, use command:\n\n```bash\nnpm install --save ngx-gauge@\u003cversion\u003e\n```\n\n#### Step 2: Import the _NgxGaugeModule_\n\n```ts\nimport { NgxGaugeModule } from 'ngx-gauge';\n\n@NgModule({\n    ...\n    imports: [NgxGaugeModule],\n    ...\n})\nexport class AppModule { }\n\n```\n\nBe sure to import `NgxGaugeModule` after Angular's `BrowserModule`, as the import order matters for _NgModules_.\n\n#### Step 3: Use gauge component in HTML\n\n`NgxGaugeModule` provides a `\u003cngx-gauge\u003e` component which can be used in any angular template to render a gauge.\nIt's configuration properties can be bind to a typescript variable as shown below:\n\n```ts\nimport { Component } from '@angular/core';\n\n@Component({\n    selector: 'app-component',\n    templateUrl: 'app.html'\n})\nexport class AppComponent {\n    \n    gaugeType = \"semi\";\n    gaugeValue = 28.3;\n    gaugeLabel = \"Speed\";\n    gaugeAppendText = \"km/hr\";\n}\n```\n\n```html\n\u003cngx-gauge [type]=\"gaugeType\" \n           [value]=\"gaugeValue\" \n           [label]=\"gaugeLabel\"  \n           [append]=\"gaugeAppendText\"\u003e\n\u003c/ngx-gauge\u003e\n```\n\nCheckout the extensive list of configuration properites given below and try them to acheive your desired customization. In case you face any problem, then raise an issue [here](https://github.com/ashish-chopra/ngx-gauge/issues).\n\n# Configuration Properties\n\nThere are plenty of configurable properties available to tune the gauge as per your needs.\n\n| Name      | Description  | Required  | Default value  | Possible values |\n| ---       | ---          | ---       | ---               | ---            |\n| `size`    | Specifies the size of the canvas in which Gauge will be drawn. It is used as `width` and `height` both. | No       | `200` | Positive Integer           |\n| `type`      | Specifies the gauge's type.                     | No        | `\"arch\"`     |  `\"full\"`, `\"semi\"`, `\"arch\"`  |\n| `min`  | Specifies the minimum numeric value for gauge's scale.  | No     | `0`  | Any numeric value  |\n| `max` | Specified the maximum numeric value for gauge's scale. | No       | `100`  | Any numeric value  |\n| `value`          | Specifies the current value of the Gauge in the range specified by `min` and `max`. It is a required attribute.       | Yes       | `undefined`  | Any numeric value |\n| `cap`       | The style of line ending at the gauge's end.    | No        | `\"butt\"`    | `\"round\"`, `\"butt\"`           |\n| `thick`        | Specified the thickness of the gauge's bar.            | No        | `6`        | Any Positive Integer |\n| `label`       | Specifies the text to display below the Gauge's reading.  | No  | `undefined`                | Any String           |\n| `foregroundColor`         | Specifies the foreground color of the Gauge's scale.                    | No       | `rgba(0, 150, 136, 1)`             |   Any color value string       |\n| `backgroundColor`    | Specifies the background color of the Gauge's scale.| No        |    `rgba(0, 0, 0, 0.1)`           |    Any color value string        |\n| `append`   | Specifies a `string` appended to the Gauge's reading. For example `\"%\"` most commonly used. | No        | `undefined`        | Any string           |\n| `prepend`      | Specifies a `string` prepended to the Gauge's reading. For example `\"$\"` in case of financial data displayed in Gauge.                                        | No        | `undefined`            | Any String           |\n| `duration`    | Specifies the duration (in milliseconds) of the Gauge's animation | No       | `1500` | Positive Integer           |\n| `thresholds` | Specifies an object of threshold values at which the gauge's color changes. Checkout an example [here](#configure-threshold-color-ranges).  | No |  `none` | {}\n| `markers` | Specifies an object of marker values at which value to place a marker. Can be a line or triangle and optionally may specify color, size and label. Note if you use labels you should add to margin value to the gauge using the margin option | No | A special object of the format shown. Currently type supports \"line\" or \"triangle\" marker. ```{ \"50\": { color: \"#555\", type: \"triangle\", size: 8, label: \"Goal\", font: \"12px arial\" } , ... }``` | {} |\n| `margin` | Specifies an optional margin for the gauge. | No | 0 | Positive Integer |\n| `animate` | toggles the gauge animation.  | No |  `true` | boolean\n| `aria-label` | Specifies the label used by screen readers | No | `undefined` | Any String\n| `aria-labelledby` | Specifies the ID of any external element to be used as label by screen readers | No | `null` | Any ID String\n\n## Configure Threshold Color Ranges\n\nYou can customize the colors of the gauge based on the current value being shown. In order to show different colors when gauge crosses certain value, use property `thresholds`. It takes an object with the threshold value  as `key` and an object with `color` property as `value`. For example:\n\n```ts\n@Component({ ... })\nexport class AppComponent {\n    ...\n\n    thresholdConfig = {\n        '0': {color: 'green'},\n        '40': {color: 'orange'},\n        '75.5': {color: 'red'}\n    };\n\n    ...\n}\n```\n\n```html\n\u003cngx-gauge ...  [thresholds]=\"thresholdConfig\"\u003e\u003c/ngx-gauge\u003e\n```\n\nThe keys in the threshold object signifies the minimum value at which the color will be applied. For instance, if the gauge's current value is `53.2`, then orange color will be applied because after point `40` every value will be displayed as `orange`, until next threshold is encountered. In this example `75.5` is the next threshold.\n\n## Custom Directives for display text\n\nSometimes setting a property value on `\u003cngx-gauge\u003e` does not solve your purpose. You may want to add custom HTML for displaying `value`,`append`, `prepend` and `label` texts. In order to provide custom templates for these properties display following directives can be used.\n\n```html\n\u003cngx-gauge [value]=\"currentValue\"\u003e\n    \u003cngx-gauge-append\u003e\n        \u003c!-- custom append text or HTML goes here --\u003e\n    \u003c/ngx-gauge-append\u003e\n    \u003cngx-gauge-label\u003e\n        \u003c!-- custom label text or HTML goes here --\u003e\n    \u003c/ngx-gauge-label\u003e\n    \u003cngx-gauge-prepend\u003e\n        \u003c!-- custom prepend text or HTML goes here --\u003e\n    \u003c/ngx-gauge-prepend\u003e\n    \u003cngx-gauge-value\u003e\n        {{ currentValue * Math.PI | number }}\n    \u003c/ngx-gauge-value\u003e\n\u003c/ngx-gauge\u003e\n```\n\nNote that `value` attribute is still required on `\u003cngx-gauge\u003e` even when you are providing custom template using `\u003cngx-gauge-value\u003e`. Because `value` attribute is responsible for calculating the gauge's drawing on a scale.\n\n\u003c!-- # Playground\n\nThe examples section is redesigned as a playground where you can play with Gauge by tuning its different parameters. \nAnd, you can see the result live on-screen. It is good start to get familiar with Gauge.\n\n![alt text](https://raw.githubusercontent.com/ashish-chopra/angular-gauge/master/examples/playground.png)\n --\u003e\n\n# Contribution Welcome\n\nThe project is continously evolving with every new release. Give it a star, if you like it. For contribution, setup the development environment as follows:\n\n1. clone and setup the project dependencies\n\n```shell\n$\u003e git clone https://github.com/ashish-chopra/ngx-gauge.git\n$\u003e npm install\n```\n\n2. Use following commands based on what you'd like to do:\n\n```shell\n$\u003e npm start             # builds the project and watch for changes. \n$\u003e npm test              # runs test suite once and exit.\n$\u003e npm run test:watch    # starts the test framework and watch for changes in code.\n$\u003e npm run build         # triggers a manual build for library, outputs at `/dist` directory.\n```\n\n3. To add a new feature or fix a bug, make sure to create a new branch from `master`.\n\nFirst thing first, explore the [issue tracker](https://github.com/ashish-chopra/ngx-gauge/issues) to find something to contribute. There are tons of other project setup related issues and activities in which you can help. Your feedback could also be a great contribution.\n\nIf you face any problem, then raise an issue [here](https://github.com/ashish-chopra/ngx-gauge/issues).\n\n# License\n\n[MIT License](https://github.com/ashish-chopra/ngx-gauge/blob/master/LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fashish-chopra%2Fngx-gauge","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fashish-chopra%2Fngx-gauge","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fashish-chopra%2Fngx-gauge/lists"}