This is a customised Meter chart. The canvas is still the usual rectangle but it has ben placed inside a DIV which has a large border-radius CSS property giving the circular appearance.
<script src="RGraph.common.core.js"></script> <script src="RGraph.common.dynamic.js"></script> <script src="RGraph.meter.js"></script>Put this where you want the chart to show up:
<canvas id="cvs" width="450" height="350">
[No canvas support]
</canvas>
This is the code that generates the chart:
<script>
window.onload = function ()
{
var meter = new RGraph.Meter({
id: 'cvs',
min: 0,
max: 100,
value: 56,
options: {
border: false,
tickmarksSmallNum: 0,
tickmarksBigNum: 0,
anglesStart: RGraph.HALFPI + (RGraph.HALFPI / 1.5),
anglesEnd: RGraph.TWOPI + RGraph.HALFPI - (RGraph.HALFPI / 1.5),
segmentRadiusStart: 140,
textSize: 16,
colorsRanges: [
[0,40,'Gradient(#0c0:#cfc:#0c0)'],
[40,80,'Gradient(yellow:#ffc:yellow)'],
[80,100,'Gradient(red:#fcc:red)']
],
needlesRadius: 110,
gutterBottom: 135
}
}).draw()
meter.canvas.onclick = function (e)
{
var obj = e.target.__object__;
var value = obj.getValue(e);
if (typeof value === 'number') {
obj.value = value;
obj.grow();
}
}
};
</script>