Sequential growth of the segments one by one in the jqxBarGauge.
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.barSpacing property – Sets or gets the space between the segments of the jqxBarGauge.colorScheme property – Sets the jqxBarGauge's color palette.endAngle propertyheight property – Sets or gets the BarGauge's height.labels property – This property is used to make fine settings on BarGauge labels at each segment.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.drawEnd event – The event is raised when the BarGauge finish rendering.val method – Returns an array of the BarGauge values.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, jqxcolorpicker.js, jqxradiobutton.js, jqxdropdownbutton.js, jqxscrollview.js, jqxbuttons.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 ()
{
var arrayOfValues = [0, 0, 0, 0];
var arrayA = [20, 0, 0, 0];
var arrayB = [20, 60, 0, 0];
var arrayC = [20, 60, 80, 0];
var arrayD = [20, 60, 80, 100];
var loop = 0;
$('#barGauge').on('drawEnd', function ()
{
switch (loop)
{
case 0:
$('#barGauge').jqxBarGauge('val', arrayA);
break;
case 1:
$('#barGauge').jqxBarGauge('val', arrayB);
break;
case 2:
$('#barGauge').jqxBarGauge('val', arrayC);
break;
case 3:
$('#barGauge').jqxBarGauge('val', arrayD);
break;
default:
console.log('Render time is finished.');
break;
}
loop += 1;
});
$('#barGauge').jqxBarGauge({
width: getWidth('barGauge'),
height: getHeight('barGauge'),
values: arrayOfValues,
animationDuration: 300,
relativeInnerRadius: 0.2,
barSpacing: 14,
startAngle: 180, endAngle: -180,
colorScheme: 'scheme02',
labels: { precision: 0, indent: 15, connectorWidth: 1 }
});
});
<div id="barGauge"></div>