Indicators

Indicators simply indicates the current status of the pointer. Indicators are in several formats such as in shape format, textual format and image format.

Adding Indicator Collection

Indicators collection is directly added to the scale object. Refer the following code to add indicator collection in a Gauge control.

  • html
  • <ej-CircularGauge id="circularGauge1" >
         <e-scales>
              <e-scale [showIndicators]="true" [indicators]="indicators: [{ height: 10,
                    width: 10,type: 'circle',value: 0,position: { x: 185, y: 300 }}]" >
              </e-scale>
           </e-scales>
      </ej-CircularGauge>

    Execute the above code to render the following output.

    Basic Customization

    You can enable indicators by setting showIndicators to ‘true’. The height and width property for the indicators are used to specify the area allocated to the indicator for the width and height respectively. You can use the position collection to position the indicators along x and y axis.

    Indicators are of several types such as, circle, rectangle, rounded rectangle, text and image. By using the type property you can avail those shapes. For image type imageUrl property is used.

  • html
  • <ej-CircularGauge id="circularGauge1" >
         <e-scales>
              <e-scale [showIndicators]="true" backgroundColor="#5DF243" [showScaleBar]="true"
                [border]="{ width: 1.5, color: 'black' }" [indicators]="indicators: [{ height: 10,
                width: 10,type: 'circle',value: 0,position: { x: 185, y: 300 }}]" >
              	<e-pointers>
                    <e-pointer backgroundColor="#5DF243" [border]="{ width: 1.5, color: 'black' }" 
                                                                       [length]="110"></e-pointer>
                </e-pointers>
              </e-scale>
           </e-scales>
      </ej-CircularGauge>

    Execute the above code to render the following output.

    State Ranges

    State ranges are used to specify the indicator behavior in the specified region. Use startValue and endValue to set the range bound for the pointer. Whenever the pointer cross the specified region, the indicator attributes are applied for ranges.

    The backgroundColor and borderColor sets the appearance behavior for the indicators. For text type indicators you can give value for text. And text can be changed whenever the pointer crosses its state range area. There are many basic font options available for the text in the state range such as size, fontStyle and fontFamily.

  • html
  • <ej-CircularGauge id="circularGauge1" >
         <e-scales>
              <e-scale [showIndicators]="true" backgroundColor="#5DF243" [showScaleBar]="true" 
                       [radius]=150 [size]=5 [indicators]="indicators:[{ height: 10,width: 10,
                       type: 'circle',value: 0,position: { x: 185, y: 300 }, stateRanges: 
                       [{endValue: 100,startValue: 0,backgroundColor: '#5DF243',borderColor: 'Black',
                       textColor: '#870505' }]}]" >
              	<e-pointers>
                    <e-pointer backgroundColor="#5DF243" [border]="{ width: 1.5, color: 'black' }"
                     [length]="110"></e-pointer>
                </e-pointers>
              </e-scale>
           </e-scales>
      </ej-CircularGauge>

    Execute the above code to render the following output.

    Multiple Indicators

    You can use multiple indicators for a single Gauge. Each indicator have a list of state ranges. Refer the following code example for multiple Indicators.

  • html
  • <ej-CircularGauge id="circularGauge1" >
         <e-scales>
              <e-scale [showIndicators]="true" backgroundColor="#5DF243" [showScaleBar]="true"
                  [radius]=150 [size]=5 [indicators]="gaugeIndicators" >
              	<e-pointers>
                    <e-pointer [value]=70 [length]="110">
                    </e-pointer>
                </e-pointers>
                <e-ranges>
                    <e-range [distanceFromScale]='-30' [startValue]='0' [endValue]='50' 
                            backgroundColor="Green" placement="far"></e-range>
                    <e-range [distanceFromScale]='-30' [startValue]='50' [endValue]='100' 
                            backgroundColor="red" placement="far"></e-range>
                </e-ranges>
              </e-scale>
           </e-scales>
      </ej-CircularGauge>
  • ts
  • this.gaugeIndicators = [
           //Indicator1
           {
               height: 10,
               width: 10,
               type: "circle",
               value: 0,
               position: { x: 165, y: 300 },
               stateRanges: [{
                   endValue: 50,
                   startValue: 0,
                   backgroundColor: "#24F92F",
                   borderColor: "Black"
               }, {
                   endValue: 50,
                   startValue: 100,
                   backgroundColor: "#322C04",
                   borderColor: "Black"
               }]
           },
           //Indicator2
           {
               height: 10,
               width: 10,
               type: "circle",
               value: 0,
               position: { x: 215, y: 300 },
               stateRanges: [{
                   endValue: 50,
                   startValue: 0,
                   backgroundColor: "#600000",
                   borderColor: "Black"
               }, {
                   endValue: 100,
                   startValue: 50,
                   backgroundColor: "#FF4F2A",
                   borderColor: "Black"
               }]
           }];

    Execute the above code to render the following output.