Methods

19 Jan 20185 minutes to read

destroy

You can destroy the Digital Gauge widget by calling it’s destroy() method.

  • HTML
  • <div id="DigitalGauge1">Digital Gauge</div> 
    
    <script>
    $("#DigitalGauge1").ejDigitalGauge();
    var graphObj = $("#DigitalGauge1").data("ejDigitalGauge");
    graphObj.destroy();
    </script>

    getPosition(itemIndex)

    To get the location of an item that is displayed on the gauge you can use getPosition() method.

    Name Type Description
  • HTML
  • itemIndex
    number Position value of an item that is displayed on the gauge.

    Returns: object

  • HTML
  • <div id="DigitalGauge1"></div> 
     
    <script>
    $("#DigitalGauge1").ejDigitalGauge();
    var DigitalGaugeObj = $("#DigitalGauge1").data("ejDigitalGauge");
    DigitalGaugeObj.getPosition(0); 
    </script>

    getValue(itemIndex)

    You can get the value of the item that is displayed on the gauge using getValue() method.

    Name Type Description
  • HTML
  • itemIndex
    number Index value of an item that displayed on the gauge

    Returns: object

  • HTML
  • <div id="DigitalGauge1"></div> 
     
    <script>
    $("#DigitalGauge1").ejDigitalGauge();
    var DigitalGaugeObj = $("#DigitalGauge1").data("ejDigitalGauge");
    DigitalGaugeObj.getValue(0);    
    </script>

    refresh()

    To refresh the Digital Gauge, you can call it’s refresh method.

  • HTML
  • <div id="DigitalGauge1"></div> 
     
    <script>
    $("#DigitalGauge1").ejDigitalGauge();
    var GaugeObj = $("#DigitalGauge1").data("ejDigitalGauge");
    GaugeObj.refresh();
    </script>

    setPosition(itemIndex, value)

    Using setPosition() method, you can set the location of an item to be displayed in the digital gauge.

    Name Type Description
  • HTML
  • itemIndex
    number Index value of the digital gauge item
  • HTML
  • value
    object Location value of the digital gauge
  • HTML
  • <div id="DigitalGauge1"></div> 
     
    <script>
    $("#DigitalGauge1").ejDigitalGauge();
    var DigitalGaugeObj = $("#DigitalGauge1").data("ejDigitalGauge");
    DigitalGaugeObj.setPosition(0,{ x:50, y:40 });  
    </script>

    setValue(itemIndex, value)

    Using setValue method,you can set the value of an item to be displayed in the digital gauge.

    Name Type Description
  • HTML
  • itemIndex
    number Index value of the digital gauge item
  • HTML
  • value
    string Text value to be displayed in the gaugeS
  • HTML
  • <div id="DigitalGauge1"></div> 
     
    <script>
    $("#DigitalGauge1").ejDigitalGauge();
    var DigitalGaugeObj = $("#DigitalGauge1").data("ejDigitalGauge");
    DigitalGaugeObj.setValue(0,"Welcome");
    </script>

    Events

    19 Jan 20185 minutes to read

    init

    init event triggers, when gauge is initialized.

  • HTML
  • <div id="DigitalCore"></div> 
     
    <script>
    $("#DigitalCore").ejDigitalGauge({
       init: function (args) {}
    });      
    </script>

    itemRendering

    itemRendering event triggers, when gauge item is rendering.

  • HTML
  • <div id="DigitalCore"></div> 
     
    <script>
    $("#DigitalCore").ejDigitalGauge({
       itemRendering: function (args) {}
    });      
    </script>

    load

    load event triggers, when gauge is starting to load.

  • HTML
  • <div id="DigitalCore"></div> 
     
    <script>
    $("#DigitalCore").ejDigitalGauge({
       load: function (args) {}
    });      
    </script>

    renderComplete

    renderComplete event triggers, when gauge rendering is completed.

  • HTML
  • <div id="DigitalCore"></div> 
     
    <script>
    $("#DigitalCore").ejDigitalGauge({
       renderComplete: function (args) {}
    });       
    </script>

    click

    click event triggers on clicking the gauges.

  • HTML
  • <div id="DigitalCore"></div> 
     
    <script>
    $("#DigitalCore").ejDigitalGauge({
    
        click: function (args) {
                  //Do something
        }
       
    });      
    </script>

    doubleClick

    doubleClick event triggers on double clicking the gauges.

  • HTML
  • <div id="DigitalCore"></div> 
     
    <script>
    $("#DigitalCore").ejDigitalGauge({
    
        doubleClick: function (args) {
                  //Do something
        }
       
    });       
    </script>

    rightClick

    rightClick event triggers on right clicking the gauges.

  • HTML
  • <div id="DigitalCore"></div> 
     
    <script>
    $("#DigitalCore").ejDigitalGauge({
        rightClick: function (args) {
                  //Do something
        }
       
    });       
    </script>