jqxBarGauge displays an indicator within a range of values. Gauges can be used in a table or matrix to show the relative value of a field in a range of values in the data region.
A live JavaScript/jQuery example of jqxBarGauge, the jQWidgets BarGauge component, with its complete source code below. It is one of 8 jqxBarGauge demos for jQuery.
colorScheme property – Sets the jqxBarGauge's color palette.formatFunction property – Sets or gets the formatFunction of the BarGauge.height property – Sets or gets the BarGauge's height.max property – Sets or gets the end value of BarGauge.tooltip property – Sets or gets the BarGauge's tooltip.values property – Sets or gets array of values for the BarGauge.width property – Sets or gets the BarGauge's width.To run it in your own page, load jqx.base.css, a theme and the library files below from npm (npm install jqwidgets-scripts) or the jsDelivr CDN, then add the markup and the script. jQuery is not required: jqxcore.js provides $.
The page loads jqx.base.css, a theme and these library files: jqxcore.js, jqxdraw.js, jqxbargauge.js.
It also loads helper scripts of this demo site, which are not part of the library: demos.js (getWidth() and other layout helpers).
$(document).ready(function ()
{
$('#barGauge').jqxBarGauge({
colorScheme: "scheme02",
width: getWidth('barGauge'),
height: getHeight('barGauge'),
values: [102, 115, 130, 137], max: 150, tooltip: {
visible: true, formatFunction: function (value)
{
var realVal = parseInt(value);
return ('Year: 2026<br/>Price Index:' + realVal);
},
}
});
});
<div id="barGauge"></div>