Html LinearGauge

Invoke the val method of the jqxLinearGauge. Author: http://jqwidgets.com

HTML

<link rel="stylesheet" href="http://jqwidgets.com/public/jqwidgets/styles/jqx.base.css">
<link rel="stylesheet" href="http://jqwidgets.com/public/jqwidgets/styles/jqx.energyblue.css">
<script src="http://jqwidgets.com/public/jqwidgets/jqx-all.js"></script>
<div id="gaugeContainer"></div>
<br/>
<input type="button" id="jqxbutton" value="Set new value" />

CSS

#jqxbutton {
  margin: 20;
}

JavaScript

$('#gaugeContainer').jqxLinearGauge({
  max: 70,
  min: 0,
  colorScheme: 'scheme02',
  ticksMajor: {
    size: '10%',
    interval: 10
  },
  ticksMinor: {
    size: '5%',
    interval: 2.5,
    style: {
      'stroke-width': 1,
      stroke: '#aaaaaa'
    }
  },
  ranges: [{
    startValue: 20,
    endValue: 45,
    style: {
      fill: '#FFA200',
      stroke: '#FFA200'
    }
  }, {
    startValue: 45,
    endValue: 70,
    style: {
      fill: '#FF4800',
      stroke: '#FF4800'
    }
  }]
});

$('#gaugeContainer').jqxTooltip({ position: 'bottom' });

$("#jqxbutton").jqxButton({
  theme: 'energyblue',
  width: 200,
  height: 30
});

$('#jqxbutton').click(function () {
  $('#gaugeContainer').jqxLinearGauge('val', 40);
});

$('#gaugeContainer').bind('valueChanging', function (e) {
  var value = e.args.value;
  $('#gaugeContainer').jqxTooltip({ content: value });
});