JavaScript/jQuery LinearGauge - animation
Type:
viz/gauges/base_gauge:BaseGaugeAnimation
To make your gauge "live", enable animation for it by setting the enabled property of the animation object to true. In this instance, the gauge indicators will appear in motion. In addition, within the animation object, you can set an appropriate easing mode using the easing property and specify how long the animation should run using the duration property.
jQuery
index.js
$(function() { $("#linearGaugeContainer").dxLinearGauge({ // ... animation: { easing: "linear", duration: 500 } }); });
Angular
app.component.html
app.component.ts
app.module.ts
<dx-linear-gauge ... > <dxo-animation easing="linear" [duration]="500"> </dxo-animation> </dx-linear-gauge>
import { Component } from '@angular/core'; @Component({ selector: 'app-root', templateUrl: './app.component.html', styleUrls: ['./app.component.css'] }) export class AppComponent { // ... }
import { BrowserModule } from '@angular/platform-browser'; import { NgModule } from '@angular/core'; import { AppComponent } from './app.component'; import { DxLinearGaugeModule } from 'devextreme-angular'; @NgModule({ declarations: [ AppComponent ], imports: [ BrowserModule, DxLinearGaugeModule ], providers: [ ], bootstrap: [AppComponent] }) export class AppModule { }
Vue
App.vue
<template> <DxLinearGauge ... > <DxAnimation easing="linear" :duration="500" /> </DxLinearGauge> </template> <script> import 'devextreme/dist/css/dx.light.css'; import DxLinearGauge, { DxAnimation } from 'devextreme-vue/linear-gauge'; export default { components: { DxLinearGauge, DxAnimation }, // ... } </script>
React
App.js
import React from 'react'; import 'devextreme/dist/css/dx.light.css'; import LinearGauge, { Animation } from 'devextreme-react/linear-gauge'; class App extends React.Component { render() { return ( <LinearGauge ... > <Animation easing="linear" duration={500} /> </LinearGauge> ); } } export default App;
ASP.NET MVC Controls
Razor C#
@(Html.DevExtreme().LinearGauge() @* ... *@ .Animation(a => a .Easing(VizAnimationEasing.Linear) .Duration(500) ) )
easing
Type:
Default Value: 'easeOutCubic'
The animation easing mode specifies the speed at which the animation progresses at different points within the animation. The following values are available.
- easeOutCubic
The animation progresses according to the Ease-out cubic interpolation function - quickly at the beginning and slowly at the end of the animation process. - linear
The animation progresses at a constant pace.
Feel free to share topic-related thoughts here.
If you have technical questions, please create a support ticket in the DevExpress Support Center.
Thank you for the feedback!
If you have technical questions, please create a support ticket in the DevExpress Support Center.