The jqxBarGauge tooltips in this demo are customized.
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.
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.startAngle property – Sets or gets the startAngle of the BarGauge.title property – Sets or gets the BarGauge's title.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 () {
var players = [25, 46, 6, 55, 14, 22, 57, 40, 87, 20];
var boundary = 33;
$('#barGauge').jqxBarGauge({
width: getWidth('barGauge'),
height: getHeight('barGauge'),
title: { text: 'Ranking', subtitle: '(boundary - ' + boundary + ' points)' },
values: players,
baseValue: boundary,
colorScheme: "scheme04",
max: 90,
labels: {
formatFunction: function (value) {
var realVal = parseInt(value);
return realVal + ' pts';
},
font: { size: 12 },
indent: 10
},
tooltip: {
classname: "myTooltip",
formatFunction: function (value) {
var realVal = parseInt(value);
var player = players.indexOf(realVal) + 1;
return ('Player ' + player + ': ' + realVal + ' points');
},
visible: true
},
startAngle: 180,
endAngle: -65
});
});
<div id="barGauge"></div>