Your search did not match any results.
Linear Gauge

Base Value for Range Bar


By default, the RangeBar starts from the beginning of the LinerGauge scale. This demo illustrates how to use the baseValue option to specify the scale value from which the RangeBar should be drawn.

Copy to CodeSandBox
<div class="long-title"> <h3>Deviation from the Target (Horizontal and Vertical)</h3> </div> <div id="gauge-demo"> <dx-circular-gauge id="c1" [value]="20"> <dxo-value-indicator type="rangebar" [baseValue]="0"> </dxo-value-indicator> <dxo-geometry [startAngle]="135" [endAngle]="45"> </dxo-geometry> <dxo-scale [startValue]="45" [endValue]="-45" [tickInterval]="45"> <dxo-label [customizeText]="customizeText"></dxo-label> </dxo-scale> </dx-circular-gauge> <dx-linear-gauge id="c2" [value]="-10"> <dxo-value-indicator [baseValue]="0"></dxo-value-indicator> <dxo-geometry orientation="vertical"></dxo-geometry> <dxo-scale [startValue]="-45" [endValue]="45" [tickInterval]="45"> <dxo-label [customizeText]="customizeText"></dxo-label> </dxo-scale> </dx-linear-gauge> </div>
import { NgModule, Component, enableProdMode } from '@angular/core'; import { BrowserModule } from '@angular/platform-browser'; import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; import { DxLinearGaugeModule, DxCircularGaugeModule } from 'devextreme-angular' if(!/localhost/.test( { enableProdMode(); } @Component({ selector: 'demo-app', templateUrl: 'app/app.component.html', styleUrls: ['app/app.component.css'] }) export class AppComponent { customizeText(arg: any) { return arg.valueText + "°"; } } @NgModule({ imports: [ BrowserModule, DxLinearGaugeModule, DxCircularGaugeModule ], declarations: [AppComponent], bootstrap: [AppComponent] }) export class AppModule { } platformBrowserDynamic().bootstrapModule(AppModule);
::ng-deep #gauge-demo { height: 440px; width: 100%; } ::ng-deep #c1 { width: 70%; height: 100%; float: left; } ::ng-deep #c2 { width: 30%; height: 100%; float: left; } ::ng-deep .long-title h3 { font-family: 'Segoe UI Light', 'Helvetica Neue Light', 'Segoe UI', 'Helvetica Neue', 'Trebuchet MS', Verdana; font-weight: 200; font-size: 28px; text-align: center; margin-bottom: 20px; }
// 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: // System.config({ transpiler: 'ts', typescriptOptions: { module: "system", emitDecoratorMetadata: true, experimentalDecorators: true }, meta: { 'typescript': { "exports": "ts" }, }, paths: { 'npm:': '' }, map: { 'ts': 'npm:plugin-typescript@8.0.0/lib/plugin.js', 'typescript': 'npm:typescript@3.4.5/lib/typescript.js', '@angular': 'npm:@angular', 'tslib': 'npm:tslib/tslib.js', 'rxjs': 'npm:rxjs', 'devextreme': 'npm:devextreme@20.1', 'jszip': 'npm:jszip@3.1.3/dist/jszip.min.js', 'quill': 'npm:quill@1.3.7/dist/quill.js', 'devexpress-diagram': 'npm:devexpress-diagram@1.0.17', 'devexpress-gantt': 'npm:devexpress-gantt@1.0.10', 'devextreme-angular': 'npm:devextreme-angular@20.1' }, packages: { 'app': { main: './app.component.ts', defaultExtension: 'ts' }, 'devextreme': { defaultExtension: 'js' }, 'devextreme/events/utils': { main: 'index' }, 'devextreme/events': { main: 'index' }, }, packageConfigPaths: [ "npm:*/package.json", "npm:@angular/*/package.json", "npm:@angular/common/*/package.json", "npm:rxjs/operators/package.json", "npm:devextreme-angular@20.1/*/package.json", "npm:devextreme-angular@20.1/ui/*/package.json", ] });
<!DOCTYPE html> <html xmlns=""> <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="" /> <link rel="stylesheet" type="text/css" href="" /> <script src=""></script> <script src=""></script> <script src=""></script> <script src=""></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>