DevExtreme v26.1 is now available.

✨ Developing with AI? Leverage the DevExpress MCP Server and our AI Agent Skills.

Your search did not match any results.

Angular Gauges - Value Indicators API

This demo shows how to use the API of the CircularGauge to change its value and subvalue indicators at runtime. To get and set the values of the indicators, the value and subvalues methods are utilized.

Backend API
<div id="gauge-demo"> <div class="widget-container"> <dx-circular-gauge id="gauge" [value]="gaugeValue" [subvalues]="gaugeSubvalues" > <dxo-circular-gauge-scale [startValue]="10" [endValue]="40" [tickInterval]="5" > <dxo-circular-gauge-label [customizeText]="customizeText" ></dxo-circular-gauge-label> </dxo-circular-gauge-scale> <dxo-circular-gauge-title text="Generators Voltage (kV)"> <dxo-circular-gauge-font [size]="28"></dxo-circular-gauge-font> </dxo-circular-gauge-title> <dxo-circular-gauge-tooltip [enabled]="true"></dxo-circular-gauge-tooltip> </dx-circular-gauge> </div> <div class="options"> <div class="caption">Options</div> <div class="option"> <span>Main generator</span> <dx-number-box [(value)]="mainGenerator" [min]="10" [max]="40" [width]="100" [showSpinButtons]="true" [inputAttr]="{ 'aria-label': 'Main Generator' }" > </dx-number-box> </div> <div class="option"> <span>Additional generator 1</span> <dx-number-box [(value)]="additionalGenerator[0]" [min]="10" [max]="40" [width]="100" [showSpinButtons]="true" [inputAttr]="{ 'aria-label': 'Additional Generator One' }" > </dx-number-box> </div> <div class="option"> <span>Additional generator 2</span> <dx-number-box [(value)]="additionalGenerator[1]" [min]="10" [max]="40" [width]="100" [showSpinButtons]="true" [inputAttr]="{ 'aria-label': 'Additional Generator Two' }" > </dx-number-box> </div> <div class="option"> <dx-button text="Apply" [width]="100" (onClick)="updateValues()"> </dx-button> </div> </div> </div>
import { bootstrapApplication } from '@angular/platform-browser'; import { Component, enableProdMode, provideZoneChangeDetection } from '@angular/core'; import { DxNumberBoxModule, DxButtonModule } from 'devextreme-angular'; import { DxCircularGaugeModule, DxCircularGaugeTypes } from 'devextreme-angular/ui/circular-gauge'; if (!/localhost/.test(document.location.host)) { enableProdMode(); } @Component({ selector: 'demo-app', templateUrl: './app.component.html', styleUrls: ['./app.component.css'], imports: [ DxCircularGaugeModule, DxNumberBoxModule, DxButtonModule, ], }) export class AppComponent { mainGenerator = 34; additionalGenerator = [12, 23]; gaugeValue = 34; gaugeSubvalues = [12, 23]; customizeText: DxCircularGaugeTypes.ScaleLabel['customizeText'] = ({ valueText }) => `${valueText} kV`; updateValues() { this.gaugeValue = this.mainGenerator; this.gaugeSubvalues = this.additionalGenerator.slice(); } } bootstrapApplication(AppComponent, { providers: [ provideZoneChangeDetection({ eventCoalescing: true, runCoalescing: true }), ], });
::ng-deep .widget-container { margin-right: 320px; } .options { padding: 20px; background-color: rgba(191, 191, 191, 0.15); position: absolute; right: 0; top: 0; bottom: 0; width: 260px; } .caption { font-size: 18px; font-weight: 500; } .option { margin-top: 10px; display: flex; align-items: center; justify-content: space-between; } ::ng-deep .dx-button { margin-left: auto; }
<!DOCTYPE html> <html lang="en"> <head> <title>DevExtreme Demo</title> <meta http-equiv="X-UA-Compatible" content="IE=edge" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=5.0" /> <link rel="stylesheet" type="text/css" href="https://cdn3.devexpress.com/jslib/26.1.5/css/dx.light.css" /> </head> <body class="dx-viewport"> <div class="demo-container"> <demo-app>Loading...</demo-app> </div> <script src="https://cdn.jsdelivr.net/npm/zone.js@0.16.2/bundles/zone.umd.js"></script> <script src="./bundle.js" type="module"></script> </body> </html>