Search results

Ranges

You can categories certain interval on gauge axis using ranges property.

Start and End

Start and end value of a range in an axis can be customized by using start and end properties.

Source
Preview
app.vue
<template>
<div id="app">
    <div class='wrapper'>
    <ejs-circulargauge>
    <e-axes>
    <e-axis :ranges='ranges'></e-axis>
    </e-axes>
    </ejs-circulargauge>
   </div>
  </div>
</template>
<script>
import Vue from 'vue';
import { CircularGaugePlugin } from "@syncfusion/ej2-vue-circulargauge";

Vue.use(CircularGaugePlugin);
export default {
    data: function () {
        return {
            ranges: [{
             start: 40,
             end: 80
        }]
        }
    }
};
</script>
<style>
@import "../../node_modules/@syncfusion/ej2-vue-circulargauge/styles/material.css";
  .wrapper {
    max-width: 300px;
    margin: 0 auto;
  }
</style>

Customization

Color and thickness of the range can be customized by using color,startWidth and endWidth property.

Source
Preview
app.vue
<template>
    <div id="app">
    <div class='wrapper'>
    <ejs-circulargauge>
    <e-axes>
    <e-axis :ranges='ranges'></e-axis>
    </e-axes>
    </ejs-circulargauge>
  </div>
  </div>
</template>
<script>
import Vue from 'vue';
import { CircularGaugePlugin } from "@syncfusion/ej2-vue-circulargauge";

Vue.use(CircularGaugePlugin);
export default {
    data: function () {
        return {
            ranges: [{
             start: 40,
            end: 80, endWidth: 15,
            startWidth: 15,
            color: '#ff5985'
        }]
        }
    }
};
</script>
<style>
@import "../../node_modules/@syncfusion/ej2-vue-circulargauge/styles/material.css";
  .wrapper {
    max-width: 300px;
    margin: 0 auto;
  }
</style>

Rounded Corner Ranges

The corners of the ranges can be rounded by specifying desired values to the roundedCornerRadius property.

Source
Preview
app.vue
<template>
<div id="app">
      <div class='wrapper'>
    <ejs-circulargauge >
    <e-axes>
      <e-axis minimum= 0 maximum= 120 :majorTicks= 'majorTicks' :ranges ='ranges'>
        <e-pointers>
           <e-pointer value=70 radius= '60%' :animation='animation' ></e-pointer>
    </e-pointers>
    </e-axis>
    </e-axes>
    </ejs-circulargauge>
  </div>
  </div>
</template>
<script>
import Vue from 'vue';
import { CircularGaugePlugin } from "@syncfusion/ej2-vue-circulargauge";

Vue.use(CircularGaugePlugin);
export default {
    data: function () {
        return {
            animation: { enable: false },
            majorTicks: {
            height: 5
        },
        ranges: [{
            start: 0,
            end: 40,
            startWidth: 15,
            endWidth: 15,
            roundedCornerRadius: 10,
            radius: '110%'
        },{
            start: 40,
            end: 80,
            startWidth: 15,
            endWidth: 15,
            roundedCornerRadius: 10,
            radius: '110%'
        },{
            start: 80,
            end: 120,
            startWidth: 15,
            endWidth: 15,
            roundedCornerRadius: 10,
            radius: '110%'
        }]
        }
    }
};
</script>
<style>
@import "../../node_modules/@syncfusion/ej2-vue-circulargauge/styles/material.css";
  .wrapper {
    max-width: 300px;
    margin: 0 auto;
  }
</style>

Radius

You can place the range inside or outside of the axis by using radius property. The radius of the range can takes value either in percentage or in pixels. By default, ranges take 100% of the axis radius.

In Pixel

You can set the radius of the range in pixel as demonstrated below,

Source
Preview
app.vue
<template>
    <div id="app">
    <div class='wrapper'>
    <ejs-circulargauge>
    <e-axes>
    <e-axis :ranges='ranges'></e-axis>
    </e-axes>
    </ejs-circulargauge>
  </div>
  </div>
</template>
<script>
import Vue from 'vue';
import { CircularGaugePlugin } from "@syncfusion/ej2-vue-circulargauge";

Vue.use(CircularGaugePlugin);
export default {
    data: function () {
        return {
            ranges: [{
             start: 40,
             end: 80,
             radius: '100'
        }]
        }
    }
};
</script>
<style>
@import "../../node_modules/@syncfusion/ej2-vue-circulargauge/styles/material.css";
  .wrapper {
    max-width: 300px;
    margin: 0 auto;
  }
</style>

In Percentage

By setting value in percentage, range gets its dimension with respect to its axis radius. For example, when the radius is ‘50%’, range renders to half of the axis radius.

Source
Preview
app.vue
<template>
    <div id="app">
    <div class='wrapper'>
    <ejs-circulargauge>
    <e-axes>
    <e-axis  minimum= 0 maximum= 100 :ranges='ranges'></e-axis>
    </e-axes>
    </ejs-circulargauge>
  </div>
  </div>
</template>
<script>
import Vue from 'vue';
import { CircularGaugePlugin } from "@syncfusion/ej2-vue-circulargauge";

Vue.use(CircularGaugePlugin);
export default {
    data: function () {
        return {
            ranges: [{
             start: 40,
             end: 80,
             radius: '50%'
        }]
        }
    }
};
</script>
<style>
@import "../../node_modules/@syncfusion/ej2-vue-circulargauge/styles/material.css";
  .wrapper {
    max-width: 300px;
    margin: 0 auto;
  }
</style>

Multiple Ranges

You can add multiple ranges to an axis with the above customization as demonstrated below.

Note: You can set the range color to axis ticks and labels by enabling useRangeColor property in majorTicks, minorTicks and labelStyle object.

Source
Preview
app.vue
<template>
    <div id="app">
    <div class='wrapper'>
   <ejs-circulargauge >
    <e-axes>
    <e-axis  :majorTicks= 'majorTicks' :minorTicks= 'minorTicks' :labelStyle= 'labelStyle' :ranges='ranges'></e-axis>
    </e-axes>
    </ejs-circulargauge>
  </div>
  </div>
</template>
<script>
import Vue from 'vue';
import { CircularGaugePlugin } from "@syncfusion/ej2-vue-circulargauge";

Vue.use(CircularGaugePlugin);
export default {
    data: function () {
        return {
        majorTicks: {
          useRangeColor: true
        },
        minorTicks: {
            useRangeColor: true
        },
        labelStyle: {
            useRangeColor: true
        },
            ranges: [{
            start: 0,
            end: 25,
            radius: '108%'
        },{
            start: 25,
            end: 50,
            radius: '70%'
        },{
            start: 50,
            end: 75,
            radius: '70%'
        },{
            start: 75,
            end: 100,
            radius: '108%'
        }]
        }
    }
};
</script>
<style>
@import "../../node_modules/@syncfusion/ej2-vue-circulargauge/styles/material.css";
  .wrapper {
    max-width: 300px;
    margin: 0 auto;
  }
</style>