Interaction and Animation

17 Nov 2017 / 2 minutes to read

  • Linear Gauge control contains Interaction feature. You can use this interaction feature to change the pointer values manually either by clicking or dragging the pointer over the Gauge. It dynamically changes the value of pointer when dragged. To Enable/Disable the user interaction you can use the readOnly Boolean property. The user interaction option is enabled when you set readOnly property as false. By default it holds the true value.
  • Linear Gauge contains another attractive concept called Animation. The animation option enables the movement of the pointer from the minimum value to the current value. You can use animation option to change the pointer value dynamically. You can enable/ disable it using enableAnimation property. To enable animation set enableAnimation to ‘true’.
  • By default it holds the true value. You can control the speed of the pointer during animating using animationSpeed. It is a numerical value that holds the time in milliseconds. That is when setting value is 1000, it is considered as 1 second.
  • js
  • @(Html.EJ().LinearGauge("LinearGauge1").Width(300).Height(500).Minimum(10).Maximum(110)
    //Adding scale collection
    .Scales(scale => {
        scale.Width(0).Border(border => border.Color("transparent").Width(0))
        //Adding marker pointer collection
        .MarkerPointers(mp => { mp.Width(10).Length(10)
        .MarkerBackgroundColor("Grey").MarkerDistanceFromScale(20).Add(); })
        //Adding bar pointer collection
        .BarPointers(bar =>
        //Adding tick collection
        .Ticks(tic =>
            .DistanceFromScale(distance => distance.X(7).Y(0)).Add();
            .DistanceFromScale(distance => distance.X(7).Y(0)).Height(6).Add();

    Execute the above code to render the following output.