Search results

Pointers

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

Source
Preview
index.tsx
import * as React from "react";
import * as ReactDOM from "react-dom";
import { CircularGaugeComponent, AxesDirective, AxisDirective, PointersDirective, PointerDirective } from '@syncfusion/ej2-react-circulargauge';
ReactDOM.render(
  <CircularGaugeComponent id='circulargauge'>
    <AxesDirective>
      <AxisDirective>
        <PointersDirective>
            <PointerDirective value = {90}></PointerDirective>
        </PointersDirective>
      </AxisDirective>
    </AxesDirective>
  </CircularGaugeComponent>,document.getElementById('circulargauge'));

Gauge supports 3 types of pointers such as Needle, RangeBar and Marker. You can choose any one of the pointer by using type property.

Needle Pointers

A needle pointer contains three parts, a needle, a cap / knob and a tail. The length of the needle can be customized by using radius property. The length of the tail can be customized by using length property. The radius of the cap can be customized by using radius in cap object. The needle and tail length takes value either in percentage or pixel.

Source
Preview
index.tsx
import * as React from "react";
import * as ReactDOM from "react-dom";
import { CircularGaugeComponent, AxesDirective, AxisDirective, PointersDirective, PointerDirective } from '@syncfusion/ej2-react-circulargauge';
ReactDOM.render(
  <CircularGaugeComponent id='circulargauge'>
    <AxesDirective>
      <AxisDirective>
        <PointersDirective>
            <PointerDirective value = {90} radius = '50%' cap = {{
                    radius: 10
                }} needleTail = {{
                    length: '25%'
                }}>
            </PointerDirective>
        </PointersDirective>
      </AxisDirective>
    </AxesDirective>
  </CircularGaugeComponent>,document.getElementById('circulargauge'));

Customization

Needle color and width can be customized by using color and pointerWidth property. Cap and tails can be customized by using cap and needleTail object.

Source
Preview
index.tsx
import * as React from "react";
import * as ReactDOM from "react-dom";
import { CircularGaugeComponent, AxesDirective, AxisDirective, PointersDirective, PointerDirective } from '@syncfusion/ej2-react-circulargauge';
ReactDOM.render(
  <CircularGaugeComponent id='circulargauge'>
    <AxesDirective>
      <AxisDirective>
        <PointersDirective>
            <PointerDirective value = {90} radius = '50%' cap = {{
                radius: 15,
                color: 'white',
                border: {
                    color: '#007DD1',
                    width: 5
                }
            }} needleTail = {{
                length: '22%',
                color: '#007DD1'
            }} color = '#007DD1' pointerWidth = {25}>
            </PointerDirective>
        </PointersDirective>
      </AxisDirective>
    </AxesDirective>
  </CircularGaugeComponent>,document.getElementById('circulargauge'));

RangeBar Pointer

RangeBar pointer is like ranges in an axis, that can be placed on gauge to mark the pointer value. RangeBar starts from the beginning of the gauge and ends at the pointer value.

Source
Preview
index.tsx
import * as React from "react";
import * as ReactDOM from "react-dom";
import { CircularGaugeComponent, AxesDirective, AxisDirective, PointersDirective, PointerDirective } from '@syncfusion/ej2-react-circulargauge';
ReactDOM.render(
  <CircularGaugeComponent id='circulargauge'>
    <AxesDirective>
      <AxisDirective>
        <PointersDirective>
            <PointerDirective value = {50} type = 'RangeBar' radius = '60%'>
            </PointerDirective>
        </PointersDirective>
      </AxisDirective>
    </AxesDirective>
  </CircularGaugeComponent>,document.getElementById('circulargauge'));

Customization

RangeBar can be customized in terms of color, border and thickness by using color, border and pointerWidth property.

Source
Preview
index.tsx
import * as React from "react";
import * as ReactDOM from "react-dom";
import { CircularGaugeComponent, AxesDirective, AxisDirective, PointersDirective, PointerDirective } from '@syncfusion/ej2-react-circulargauge';
ReactDOM.render(
  <CircularGaugeComponent id='circulargauge'>
    <AxesDirective>
      <AxisDirective>
        <PointersDirective>
            <PointerDirective  value = {50} type = 'RangeBar' radius = '60%' color = '#007DD1'
                border = {{
                    color: 'grey',
                    width: 2
                }} pointerWidth = {15}>
            </PointerDirective>
        </PointersDirective>
      </AxisDirective>
    </AxesDirective>
  </CircularGaugeComponent>,document.getElementById('circulargauge'));

Marker Pointer

Different type of marker shape can be used to mark the pointer value in axis. You can change the marker shape using markerShape property in pointer. Gauge marker supports Circle, Rectangle, Triangle, InvertedTriangle and Diamond shape.

We can use image instead of rendering marker shape to denote the pointer value. It can be achieved by setting markerShape to Image and assigning  image path to imageUrl in pointer.

Source
Preview
index.tsx
import * as React from "react";
import * as ReactDOM from "react-dom";
import { CircularGaugeComponent, AxesDirective, AxisDirective, PointersDirective, PointerDirective } from '@syncfusion/ej2-react-circulargauge';
ReactDOM.render(
  <CircularGaugeComponent id='circulargauge'>
    <AxesDirective>
      <AxisDirective>
        <PointersDirective>
            <PointerDirective value = {90} type = 'Marker' markerShape = 'InvertedTriangle'
                radius = '100%' markerHeight = {15} markerWidth = {15}>
            </PointerDirective>
        </PointersDirective>
      </AxisDirective>
    </AxesDirective>
  </CircularGaugeComponent>,document.getElementById('circulargauge'));

Customization

The marker can be customized in terms of color, border, width and height by using color, border, markerWidth and markerHeight property in pointer.

Source
Preview
index.tsx
import * as React from "react";
import * as ReactDOM from "react-dom";
import { CircularGaugeComponent, AxesDirective, AxisDirective, PointersDirective, PointerDirective } from '@syncfusion/ej2-react-circulargauge';
ReactDOM.render(
  <CircularGaugeComponent id='circulargauge'>
    <AxesDirective>
      <AxisDirective>
        <PointersDirective>
            <PointerDirective value = {90} type = 'Marker' markerShape = 'Triangle' radius = '100%'
                color = 'white' border= {{
                color: '#007DD1',
                width: 2
            }} markerHeight = {15} markerWidth = {15}>
            </PointerDirective>
        </PointersDirective>
      </AxisDirective>
    </AxesDirective>
  </CircularGaugeComponent>,document.getElementById('circulargauge'));

Multiple Pointers

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

Source
Preview
index.tsx
import * as React from "react";
import * as ReactDOM from "react-dom";
import { CircularGaugeComponent, AxesDirective, AxisDirective, PointersDirective, PointerDirective } from '@syncfusion/ej2-react-circulargauge';
ReactDOM.render(
  <CircularGaugeComponent id='circulargauge'>
    <AxesDirective>
      <AxisDirective>
        <PointersDirective>
            <PointerDirective value = {90} type = 'Marker' markerShape = 'InvertedTriangle'
                radius = '100%' markerHeight = {15} markerWidth = {15}>
            </PointerDirective>
            <PointerDirective value = {90} type = 'RangeBar' radius = '60%' pointerWidth = {10}>
            </PointerDirective>
            <PointerDirective value = {90} radius = '60%' pointerWidth = {25} cap = {{
                radius: 15,
                border: {
                    width: 5
                }
            }} needleTail = {{
                length: '22%',
            }}>
            </PointerDirective>
        </PointersDirective>
      </AxisDirective>
    </AxesDirective>
  </CircularGaugeComponent>,document.getElementById('circulargauge'));

Animation

Pointer will get animate on loading the gauge, this can be handled by using animation property in pointer. The enable property in animation allows you to enable or disable the animation. The duration property specify the duration of the animation in milliseconds.

Source
Preview
index.tsx
import * as React from "react";
import * as ReactDOM from "react-dom";
import { CircularGaugeComponent, AxesDirective, AxisDirective, PointersDirective, PointerDirective } from '@syncfusion/ej2-react-circulargauge';
ReactDOM.render(
  <CircularGaugeComponent id='circulargauge'>
    <AxesDirective>
      <AxisDirective>
        <PointersDirective>
            <PointerDirective value = {90} animation= {{
                enable: true,
                duration: 1500
            }}></PointerDirective>
        </PointersDirective>
      </AxisDirective>
    </AxesDirective>
  </CircularGaugeComponent>,document.getElementById('circulargauge'));