Search results

Pointers in Vue Linear Gauge component

Pointers are used to indicate values on the axis. Value of the pointer can be modified using the value property.

Source
Preview
app.vue
<template>
   <div>
    <div class="col-md-8 control-section">
    <div class="content-wrapper">
    <div align='center'>
    <ejs-lineargauge >
    <e-axes>
      <e-axis >
        <e-pointers>
           <e-pointer value=80 ></e-pointer>
    </e-pointers>
    </e-axis>
    </e-axes>
    </ejs-lineargauge>
   </div>
  </div>
  </div>
  </div>
</template>
<script>
import Vue from 'vue';
import { LinearGaugePlugin } from "@syncfusion/ej2-vue-lineargauge";

Vue.use(LinearGaugePlugin);
export default { };
</script>
<style>
#content-wrapper {
    padding: 0px !important;
}
</style>

Types of pointer

The Linear Gauge supports the following two types of pointers:

  • Bar
  • Marker

You can choose any one of the pointer by using type property.

Marker Pointer

A marker pointer is a shape, that can be placed to mark the pointer value in the linear gauge.

Types of marker shapes

The following marker types are available in linear gauge. You can change the marker shape using markerType property in pointer options. The available marker types are,

  • Circle
  • Rectangle
  • Triangle
  • InvertedTriangle
  • Diamond

You can also use image instead of rendering shape as pointer. It can be achieved by using markerType property as Image set image path to ‘imageUrl’ in pointer.

Source
Preview
app.vue
<template>
   <div>
    <div class="content-wrapper">
    <div align='center'>
    <ejs-lineargauge >
    <e-axes>
      <e-axis >
        <e-pointers>
           <e-pointer value=80 type= 'Marker'  markerType= 'Circle' ></e-pointer>
    </e-pointers>
    </e-axis>
    </e-axes>
    </ejs-lineargauge>
   </div>
  </div>
  </div>
</template>
<script>
import Vue from 'vue';
import { LinearGaugePlugin } from "@syncfusion/ej2-vue-lineargauge";

Vue.use(LinearGaugePlugin);
export default { };
</script>
<style>
#content-wrapper {
    padding: 0px !important;
}
</style>

Marker Pointer Customization

The marker can be customized by using the following properties.

  • height - Specifies pointer height
  • width - Specifies pointer width
  • color - Specifies pointer color
  • placement - Specifies pointer placement position, available placement options are ‘Near’, ‘Far’, ‘Center’ and ‘None’
  • offset - Specifies offset value from it default position.
  • animationDuration - Specifies pointer animation duration
  • border - Specifies pointer border color and width

Bar Pointer

Bar pointer is used to track the axis value and it will render depending upon the container type. Bar pointer starts from the beginning of the gauge and ends at the pointer value.

Source
Preview
app.vue
<template>
   <div>
    <div class="content-wrapper">
    <div align='center'>
    <ejs-lineargauge >
    <e-axes>
      <e-axis >
        <e-pointers>
           <e-pointer value=80 type= 'Bar'></e-pointer>
    </e-pointers>
    </e-axis>
    </e-axes>
    </ejs-lineargauge>
   </div>
  </div>
  </div>
</template>
<script>
import Vue from 'vue';
import { LinearGaugePlugin } from "@syncfusion/ej2-vue-lineargauge";

Vue.use(LinearGaugePlugin);
export default { };
</script>
<style>
#content-wrapper {
    padding: 0px !important;
}
</style>

Bar pointer customization

The bar pointer can be customized using following properties.

  • width - Specifies bar pointer width
  • color - Specifies bar pointer color
  • offset - Helps to move the bar pointer from its default position.
  • border - Specifies bar pointer border width and color
  • placement property is not supported for bar pointer.
Source
Preview
app.vue
<template>
   <div>
    <div class="content-wrapper">
    <div align='center'>
    <ejs-lineargauge >
    <e-axes>
      <e-axis >
        <e-pointers>
           <e-pointer value=80 type= 'Bar' color= '#f44141'></e-pointer>
    </e-pointers>
    </e-axis>
    </e-axes>
    </ejs-lineargauge>
   </div>
  </div>
  </div>
</template>
<script>
import Vue from 'vue';
import { LinearGaugePlugin } from "@syncfusion/ej2-vue-lineargauge";

Vue.use(LinearGaugePlugin);
export default { };
</script>
<style>
#content-wrapper {
    padding: 0px !important;
}
</style>

Pointer placement

You can placement the marker pointer in any of the following locations using [placement] property.

  • Far
  • Near
  • Center
  • None
Source
Preview
app.vue
<template>
   <div>
    <div class="content-wrapper">
    <div align='center'>
    <ejs-lineargauge >
    <e-axes>
      <e-axis >
        <e-pointers>
           <e-pointer value=60 markerType= 'Arrow' color= '#f44141' placement= 'Near'></e-pointer>
    </e-pointers>
    </e-axis>
    </e-axes>
    </ejs-lineargauge>
   </div>
  </div>
  </div>
</template>
<script>
import Vue from 'vue';
import { LinearGaugePlugin } from "@syncfusion/ej2-vue-lineargauge";

Vue.use(LinearGaugePlugin);
export default { };
</script>
<style>
#content-wrapper {
    padding: 0px !important;
}
</style>

Multiple Pointers

In addition to the default pointer, you can add n number of pointer to an axis.

Source
Preview
app.vue
<template>
   <div>
    <div class="content-wrapper">
    <div align='center'>
    <ejs-lineargauge >
    <e-axes>
      <e-axis >
        <e-pointers>
           <e-pointer value=80 ></e-pointer>
           <e-pointer value=30 markerType= 'Diamond'></e-pointer>
           <e-pointer value=50 markerType= 'Circle'></e-pointer>
    </e-pointers>
    </e-axis>
    </e-axes>
    </ejs-lineargauge>
   </div>
  </div>
  </div>
</template>
<script>
import Vue from 'vue';
import { LinearGaugePlugin } from "@syncfusion/ej2-vue-lineargauge";

Vue.use(LinearGaugePlugin);
export default { };
</script>
<style>
#content-wrapper {
    padding: 0px !important;
}
</style>

Pointer Animation

Pointer will animate on loading the gauge. This can be handled by using animationDuration property. You need to specify the duration of the animation in milliseconds.

Source
Preview
app.vue
<template>
   <div>
    <div class="content-wrapper">
    <div align='center'>
    <ejs-lineargauge >
    <e-axes>
      <e-axis >
        <e-pointers>
           <e-pointer value=80 animationDuration= 1000></e-pointer>
    </e-pointers>
    </e-axis>
    </e-axes>
    </ejs-lineargauge>
   </div>
  </div>
  </div>
</template>
<script>
import Vue from 'vue';
import { LinearGaugePlugin } from "@syncfusion/ej2-vue-lineargauge";

Vue.use(LinearGaugePlugin);
export default { };
</script>
<style>
#content-wrapper {
    padding: 0px !important;
}
</style>