New to Kendo UI for jQuery? Start a free 30-day trial

GaugeArea

configuration

The gauge area configuration options. This is the entire visible area of the gauge.

gaugeArea

Object
<div id="gauge-container">
  <div id="gauge"></div>
</div>

<script>
  $(function() {
    var value = $("#gauge-value").val();
    $("#gauge").kendoLinearGauge({
      pointer: {
        value: 28
      },
      gaugeArea: {
        border: {
          color: "green",
          width: "4px"
        }
      },
      scale: {
        majorUnit: 20,
        minorUnit: 2,
        min: -40,
        max: 60,
        vertical: true,
        ranges: [
          {
            from: -40,
            to: -20,
            color: "#2798df"
          }
        ]
      }
    });
  });
</script>

<style>
  #gauge-container {
    text-align: center;
    margin: 0 auto;
    background-size: contain;
    padding: 18px;
    width: 300px;
    height: 300px;
  }

  #gauge {
    height: 100%;
    display: inline-block;
    *display: inline;
    zoom: 1;
  }
</style>

The background of the gauge area. Any valid CSS color string will work here, including hex and rgb.

Default: "white"

<div id="gauge-container">
  <div id="gauge"></div>
</div>

<script>
  $(function() {
    var value = $("#gauge-value").val();
    $("#gauge").kendoLinearGauge({
      pointer: {
        value: 28
      },
      gaugeArea: {
        background: "#c7d6d1",
      },
      scale: {
        majorUnit: 20,
        minorUnit: 2,
        min: -40,
        max: 60,
        vertical: true,
        ranges: [
          {
            from: -40,
            to: -20,
            color: "#2798df"
          }
        ]
      }
    });
  });
</script>

<style>
  #gauge-container {
    text-align: center;
    margin: 0 auto;
    background-size: contain;
    padding: 18px;
    width: 300px;
    height: 300px;
  }

  #gauge {
    height: 100%;
    display: inline-block;
    *display: inline;
    zoom: 1;
  }
</style>

The border of the gauge area.

<div id="gauge"></div>
<script>
$("#gauge").kendoLinearGauge({
    pointer: {
        value: 25
    },
    gaugeArea: {
        border: {
            color: "#4caf50",
            width: 2,
            dashType: "solid"
        }
    },
    scale: {
        min: 0,
        max: 50
    }
});
</script>

The height of the gauge area. By default, the vertical gauge is 200px and the horizontal one is 60px.

<div id="gauge"></div>
<script>
$("#gauge").kendoLinearGauge({
    pointer: {
        value: 30
    },
    gaugeArea: {
        height: 150
    },
    scale: {
        min: 0,
        max: 50,
        vertical: true
    }
});
</script>
Number|Object

The margin of the gauge area.

Default: 5

js
// sets the top, right, bottom and left margin to 3px.
margin: 3

// sets the top and left margin to 1px
// margin right and bottom are with 5px (by default)
margin: { top: 1, left: 1 }

The width of the gauge area. By default the vertical gauge is 60px and horizontal gauge is 200px.

<div id="gauge"></div>
<script>
$("#gauge").kendoLinearGauge({
    pointer: {
        value: 30
    },
    gaugeArea: {
        width: 100
    },
    scale: {
        min: 0,
        max: 50,
        vertical: true
    }
});
</script>