Your search did not match any results.
Gauges

Overview

DevExtreme HTML5 JavaScript Gauge widgets are interactive Angular components for dashboards. They come in two geometric shapes - circular, or radial, and linear - and provide a comprehensive set of features including multiple value indicators, geometry customization, interactive tooltips, palettes support, and many more. Native Angular features, like AOT compilation, declarative configuration, TypeScript compile-time checking, are supported as well.

Copy to Plunker
Apply
Reset
<div id="gauge-demo"> <div id="gauge-container"> <div class="left-section"> <dx-circular-gauge [value]="speedValue / 2" > <dxo-size [width]="90" [height]="90"></dxo-size> <dxo-value-indicator color="#f05b41" > </dxo-value-indicator> <dxo-geometry [startAngle]="180" [endAngle]="90"> </dxo-geometry> <dxo-scale [startValue]="0" [endValue]="100" [tickInterval]="10"> </dxo-scale> </dx-circular-gauge> <dx-circular-gauge [value]="speedValue / 2" > <dxo-size [width]="90" [height]="90"></dxo-size> <dxo-value-indicator color="#f05b41"></dxo-value-indicator> <dxo-geometry [startAngle]="-90" [endAngle]="-180"> </dxo-geometry> <dxo-scale [startValue]="100" [endValue]="0" [tickInterval]="10"> </dxo-scale> </dx-circular-gauge> </div> <div class="center-section"> <div class="speed-value"> <span>{{speedValue}}</span> </div> <dx-circular-gauge id="speed-gauge" [value]="speedValue" > <dxo-size [width]="260"></dxo-size> <dxo-value-indicator type="twoColorNeedle" color="transparent" [secondFraction]="0.24" secondColor="#f05b41" > </dxo-value-indicator> <dxo-geometry [startAngle]="225" [endAngle]="315"> </dxo-geometry> <dxo-scale [startValue]="20" [endValue]="200" [tickInterval]="20" [minorTickInterval]="10"> </dxo-scale> </dx-circular-gauge> <dx-linear-gauge id="fuel-gauge" [value]="50 - speedValue * 0.24" > <dxo-size [width]="90" [height]="20"></dxo-size> <dxo-scale [startValue]="0" [endValue]="50" [tickInterval]="25" [minorTickInterval]="12.5" > <dxo-minor-tick [visible]="true"></dxo-minor-tick> <dxo-label [visible]="false"></dxo-label> </dxo-scale> <dxo-value-indicator color="#f05b41" [size]="8" [offset]="7" > </dxo-value-indicator> </dx-linear-gauge> </div> <div class="right-section"> <dx-circular-gauge [value]="speedValue / 2" > <dxo-size [width]="90" [height]="90"></dxo-size> <dxo-value-indicator color="#f05b41" > </dxo-value-indicator> <dxo-geometry [startAngle]="90" [endAngle]="0"> </dxo-geometry> <dxo-scale [startValue]="100" [endValue]="0" [tickInterval]="10"> </dxo-scale> </dx-circular-gauge> <dx-circular-gauge [value]="speedValue / 2" > <dxo-size [width]="90" [height]="90"></dxo-size> <dxo-value-indicator color="#f05b41"></dxo-value-indicator> <dxo-geometry [startAngle]="0" [endAngle]="-90"> </dxo-geometry> <dxo-scale [startValue]="0" [endValue]="100" [tickInterval]="10"> </dxo-scale> </dx-circular-gauge> </div> </div> <dx-slider id="slider" [min]="0" [max]="200" [width]="155" [(value)]="speedValue" > </dx-slider> </div>
import { NgModule, Component, enableProdMode } from '@angular/core'; import { BrowserModule } from '@angular/platform-browser'; import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; import { DxCircularGaugeModule, DxLinearGaugeModule, DxSliderModule } from 'devextreme-angular' if(!/localhost/.test(document.location.host)) { enableProdMode(); } @Component({ selector: 'demo-app', templateUrl: 'app/app.component.html', styleUrls: ['app/app.component.css'] }) export class AppComponent { speedValue = 40; } @NgModule({ imports: [ BrowserModule, DxCircularGaugeModule, DxLinearGaugeModule, DxSliderModule ], declarations: [AppComponent], bootstrap: [AppComponent] }) export class AppModule { } platformBrowserDynamic().bootstrapModule(AppModule);
/deep/ #gauge-demo { height: 500px; } /deep/ #gauge-container { text-align: center; margin: 20px auto; background-image: url('../../../../images/mask.png'); background-repeat: no-repeat; width: 786px; height: 500px; } /deep/ #gauge-container > div { display: inline-block; position: relative; } /deep/ .left-section { top: -20px; left: -40px; } /deep/ .center-section { top: 25px; } /deep/ .right-section { top: -20px; right: -40px; } /deep/ .speed-value { position: absolute; border: 2px solid #f05b41; border-radius: 50%; width: 110px; height: 110px; left: 28%; top: 36%; line-height: 100px; } /deep/ .speed-value > span { font-size: 50px; font-weight: lighter; color: #f05b41; } /deep/ #fuel-gauge { position: absolute; left: 34%; bottom: 5%; } /deep/ #slider { position: relative; top: -105px; margin: 0 auto; } /deep/ #slider .dx-slider-handle { background-color: #f05b41; border: none; width: 10px; height: 20px; margin-top: -10px; } /deep/ #slider .dx-slider-range.dx-slider-range-visible { border-color: #f05b41; background-color: #f05b41; }
// In real applications, you should not transpile code in the browser. You can see how to create your own application with Angular and DevExtreme here: // https://github.com/DevExpress/devextreme-angular/blob/master/README.md System.config({ transpiler: 'ts', typescriptOptions: { module: "commonjs", emitDecoratorMetadata: true, experimentalDecorators: true }, meta: { 'typescript': { "exports": "ts" } }, paths: { 'npm:': 'https://unpkg.com/' }, map: { 'ts': 'npm:plugin-typescript@7.0.6/lib/plugin.js', 'typescript': 'npm:typescript@2.2.2/lib/typescript.js', '@angular/core': 'npm:@angular/core@5.1.2/bundles/core.umd.js', '@angular/common': 'npm:@angular/common@5.1.2/bundles/common.umd.js', '@angular/compiler': 'npm:@angular/compiler@5.1.2/bundles/compiler.umd.js', '@angular/platform-browser': 'npm:@angular/platform-browser@5.1.2/bundles/platform-browser.umd.js', '@angular/platform-browser-dynamic': 'npm:@angular/platform-browser-dynamic@5.1.2/bundles/platform-browser-dynamic.umd.js', '@angular/http': 'npm:@angular/http@5.1.2/bundles/http.umd.js', '@angular/router': 'npm:@angular/router@5.1.2/bundles/router.umd.js', '@angular/forms': 'npm:@angular/forms@5.1.2/bundles/forms.umd.js', 'rxjs': 'npm:rxjs@5.3.1', 'jszip': 'npm:jszip@3.1.3/dist/jszip.min.js', 'devextreme': 'npm:devextreme@17.2', 'devextreme-angular': 'npm:devextreme-angular@17.2' }, packages: { 'app': { main: './app.component.ts', defaultExtension: 'ts' }, 'devextreme': { defaultExtension: 'js' }, 'devextreme-angular': { main: 'index.js', defaultExtension: 'js' } } });
<!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <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=1.0" /> <link rel="stylesheet" type="text/css" href="https://cdn3.devexpress.com/jslib/17.2.7/css/dx.spa.css" /> <link rel="stylesheet" type="text/css" href="https://cdn3.devexpress.com/jslib/17.2.7/css/dx.common.css" /> <link rel="dx-theme" data-theme="generic.light" href="https://cdn3.devexpress.com/jslib/17.2.7/css/dx.light.css" /> <script src="https://unpkg.com/core-js@2.4.1/client/shim.min.js"></script> <script src="https://unpkg.com/zone.js@0.6.25/dist/zone.js"></script> <script src="https://unpkg.com/reflect-metadata@0.1.3/Reflect.js"></script> <script src="https://unpkg.com/systemjs@0.19.31/dist/system.js"></script> <script src="config.js"></script> <script> System.import('app').catch(console.error.bind(console)); </script> </head> <body class="dx-viewport"> <div class="demo-container"> <demo-app>Loading...</demo-app> </div> </body> </html>