This demo displays jqxBarGauge with negative values.
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.
animationDuration property – Determines the animation in milliseconds.baseValue property – Sets the base value of jqxBarGauge.colorScheme property – Sets the jqxBarGauge's color palette.endAngle propertyformatFunction property – Sets or gets the formatFunction of the BarGauge.height property – Sets or gets the BarGauge's height.labels property – This property is used to make fine settings on BarGauge labels at each segment.max property – Sets or gets the end value of BarGauge.min property – Sets or gets BarGauge's min.relativeInnerRadius property – Sets or gets the relativeInnerRadius of jqxBarGauge.startAngle property – Sets or gets the startAngle of the BarGauge.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({
width: getWidth('barGauge'),
height: getHeight('barGauge'),
values: [12, -35, -14.78, 29.5, 23.124, 41],
relativeInnerRadius: 0.2,
min: -45,
baseValue: 0,
max: 45,
startAngle: 270,
endAngle: 90,
colorScheme: 'scheme02',
labels: {
formatFunction: function (value) {
return value + ' m';
}, precision: 1, indent: 15
},
animationDuration: 0
});
});
<div id="barGauge"></div>