var gauge = new FlexGauge({
appendTo: '#example1'
});
var gauge = new FlexGauge({
appendTo: '#example2',
animateEasing: true,
elementId: 'example2_canvas',
elementWidth: 150,
elementHeight: 150,
arcSize: 65,
arcAngleStart: 1,
arcFillPercent: .80,
arcStrokeFg: 20,
arcStrokeBg: 10,
animateSpeed: 1,
styleArcFg: 'btn-success',
styleSrc: 'background-color'
});
var gauge = new FlexGauge({
appendTo: '#example3',
arcFillPercent: Math.random(),
arcAngleStart: .6,
arcAngleEnd: 2.4,
arcStrokeFg: 15,
arcStrokeBg: 30,
colorArcFg: '#444444'
});
setInterval(function(){
gauge.update({
arcFillPercent: Math.random()
});
}, 3000);
var gauge = new FlexGauge({
appendTo: '#example4',
arcFillInt: 7,
arcFillTotal: 20,
arcAngleStart: .5,
arcAngleEnd: 1.5,
arcBgColorLight: 200,
arcBgColorSat: 50,
colorArcFg: '#FF3300',
colorArcBg: '#0033FF'
});
// ----- or -----
var gauge = new FlexGauge({
appendTo: '#example4',
arcFillStart: 5,
arcFillEnd: 12,
arcFillTotal: 20,
arcAngleStart: .5,
arcAngleEnd: 1.5,
arcBgColorLight: 200,
arcBgColorSat: 50,
colorArcFg: '#FF3300',
colorArcBg: '#0033FF'
});
var gauge = new FlexGauge({
appendTo: '#example5',
dialValue: true,
dialLabel: true
});
CSS
/** these classes are pre-generated **/
.fg-dial {
font-size: 200%;
font-weight: bold;
left: 0;
position: absolute;
text-align: center;
top: 100px;
width: 100%;
}
.fg-dial-label {
font-size: 200%;
font-weight: bold;
left: 0;
position: absolute;
text-align: center;
top: 160px;
width: 100%;
}
var gauge = new FlexGauge({
appendTo: '#example6',
dialValue: true,
dialUnit: '$',
dialUnitPosition: 'before',
dialClass: 'existingDivWithClass',
dialUnits: 'unit',
arcFillInt: 10,
arcFillTotal: 45
});
CSS
.existingDivWithClass {
font-size: 200%;
font-weight: bold;
left: 0;
position: absolute;
text-align: center;
top: 100px;
width: 100%;
}
HTML
<div class="existingDivWithClass"></div>
var holder = [
{
appendTo: '#example7',
dialValue: true,
dialClass: 'gaugeDials',
dialUnit: '$',
dialUnitPosition: 'before',
dialLabel: 'Sales Revenue',
dialLabelClass: 'gaugeDialsLabel',
arcFillInt: 150,
arcFillTotal: 550,
styleArcFg: 'alert-info',
styleSrc: 'color',
arcStrokeFg: 10,
arcStrokeBg: 20
},
{
appendTo: '#example7',
dialValue: true,
dialLabel: 'Sales Increase',
arcFillPercent: .8,
dialUnitPosition: 'after',
dialUnit: '%',
styleArcFg: 'alert-success',
styleSrc: 'color',
arcStrokeFg: 20,
arcStrokeBg: 10
}
];
var current = 0;
var gauge = new FlexGauge(holder[current]);
setInterval(function(){
current = (current == 0 ? current+1 : current-1);
gauge.update(holder[current]);
}, 5000);
CSS
.gaugeDials {
font-size: 200%;
font-weight: bold;
left: 0;
position: absolute;
text-align: center;
top: 100px;
width: 100%;
}
.gaugeDialsLabel {
font-size: 180%;
font-weight: bold;
left: 0;
position: absolute;
text-align: center;
top: 170px;
width: 100%;
}