RGraph is a JavaScript charts library based on HTML5 SVG and canvas. RGraph is mature (over 15 years old) and has a wealth of features making it an ideal choice to show charts on your website.

More »


Get the latest version of RGraph (version 6.17) from the download page. There's also older versions available, minified files and links to cdnjs.com hosted libraries.

More »


RGraph can be used for free under the GPL or if that doesn't suit your situation there's an inexpensive (£99) commercial license available.

More »

A customised Gauge chart

[No canvas support]

Here's an example of the canvas Gauge chart which is just one of the various meter-type charts that's available with RGraph. These charts are:

As you can see - there are far more canvas meters than svg ones. Though you can quite easily configure the vertical and horizontal svg Bar charts to appear as progress bars. There are demos of this being done in the download archive. There's also a demo available of a Pie chart being configured as a progress gauge and other meters here, here, here, here and here

Regarding this chart, the top and bottom titles are being configured, the colors for the banding around the Gauge are being set with specific ranges, there are multiple needles - each with its own color and the tickmarks are being configured.

As you can see it looks quite different to the standard Gauge!

The responsive function in this case doesn't change the appearance or size of the chart but instead changes the css so the float is removed from the canvas and parent div and the alignment of the parent is changed to be center aligned.

This goes in the documents header:
<script src="RGraph.common.core.js"></script>
<script src="RGraph.gauge.js"></script>
Put this where you want the chart to show up:
<div style="float: right">
    <canvas id="cvs" width="300" height="300">[No canvas support]</canvas>
This is the code that generates the chart - it should be placed AFTER the canvas tag(s):
    new RGraph.Gauge({
        id: 'cvs',
        min: 0,
        max: 200,
        value: [184,12],
        options: {
            marginLeft: 15,
            marginRight: 15,
            marginTop: 15,
            marginBottom: 15,

            // Configure the top titles appearance
            titleTop: 'Air Speed',
            titleTopSize: 22,
            titleTopFont: 'Impact',
            titleTopColor: 'white',
            titleTopSize: 24,
            titleTopItalic: true,
            // Configure the bottom titles appearance
            titleBottom: 'Knots',
            titleBottomSize: 14,
            titleBottomItalic: true,
            titleBottomFont: 'Impact',
            titleBottomColor: '#ccc',
            titleBottomPos: 0.4,

            // The rest of the configuration for the Gauge chart - the needle,
            // centerpin, tickmarks and the border
            colorsRanges: [[160,200,'rgba(255,0,0,1)'], [120,160,'rgba(255,255,0,0.95']],
            backgroundColor: 'black',
            backgroundGradient: true,
            centerpinColor: '#666',
            needleSize: [null, 50],
            needleColors: ['Gradient(transparent:white:white:white:white:white)', 'Gradient(transparent:#d66:#d66:#d66:#d66)'],
            textColor: 'white',
            tickmarksLargeColor: 'white',
            tickmarksMediumColor: 'white',
            tickmarksSmallColor: 'white',
            borderOuter: '#666',
            borderInner: '#333',
            responsive: [
                {maxWidth:null,css:{'float':'right'},parentCss:{textAlign:'none','float': 'right'}},
                {maxWidth:600,css:{'float':'none'},parentCss:{textAlign:'center','float': 'none'}}