MENU
.net Powerful JavaScript charts
About
RGraph is a JavaScript charts library based on HTML5 SVG and canvas. RGraph is mature (over 18 years old) and has a wealth of features making it an ideal choice to use for showing charts on your website.

More »

 

Version 7.20
Version 7.20 (released in June 2026) is the latest version of RGraph and the major change in this version is an update to the default values of properties making for better looking charts without having to set any properties. Read more about this and other changes in the changelog.

Download »

 

Download
Get the latest version of RGraph (version 7.20, 9th June 2026) from the download page. You can read the changelog here. There's also older versions available, minified files and links to cdnjs.com hosted libraries.

Download »

 

Latest forum posts
These are the latest support forum posts that have been posted or updated.


12th June, Marco
Should I use SVG or canvas for the charts on my website?
9th June, Richard
New version of RGraph: version 7.20
3rd June, Patrick
Question about installing RGraph
1st June, Ouja
How do I add a click event to a bar in my Bar chart?
8th May, Anthony Kuma
Does the SVG Line chart have outofbounds functionality?


Support forum »

 

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

More »

HOWTO: A horizontal or vertical progress bar

There isn't a dedicated SVG horizontal Progress bar or Vertical Progress bar but it's easy to emulate one by using the Horizontal Bar chart or Vertical Bar charts. There are two chart objects used - one for the foreground and one for the background. Because they are regular Bar charts, it means that you can use any of the Bar chart properties such as tooltips.

The background to the progress bar

The first thing to do is create the background of the progress bar. This is a regular Bar chart that has a single value of 10. This leads to a scale generated for you of 0 - 10.

<script>
    vprogress1 = new RGraph.SVG.Bar({
        id: 'chart-container',
        data: [10],
        options: {
            backgroundGrid: false,
            marginInner: 0,
            colors: ['#eee']
        }
    }).draw();
</script>

After the red bar has been added

<script>
    vprogress2 = new RGraph.SVG.Bar({
        id: 'chart-container',
        data: [10],
        options: {
            backgroundGrid: false,
            marginInner: 0,
            colors: ['#eee']
        }
    }).draw();

    vprogress3 = new RGraph.SVG.Bar({
        id: 'chart-container',
        data: [8],
        options: {
            backgroundGrid: false,
            marginInner: 7,
            colors: ['Gradient(red:#faa)']
        }
    }).grow({frames: 60});
</script>

A Horizontal Progress Bar

To create a Horizontal Progress Bar the methodology is very much the same but instead of using the regular Bar chart, you would use the Horizontal Bar chart. Here's an example of it along with some sample code.

<script>
    new RGraph.SVG.HBar({
        id: 'chart-container',
        data: [10],
        options: {
            marginTop: 5,
            marginLeft: 15,
            marginRight: 15,
            marginTop: 5,
            colors: ['#eee'],
            backgroundGrid: false,
            colorsStroke: '#ccc',
            xaxisScale: false,
            linewidth: .5
        }
    }).draw();

    new RGraph.SVG.HBar({',
        id: 'chart-container',
        data: [7],
        options: {
            marginLeft: 15,
            marginRight: 15,
            marginTop: 5,
            xaxisScaleUnitsPost: '%',
            xaxisScaleMax: 10,
            colors: ['Gradient(#fcc:red)'],
            backgroundGrid: false,
            marginInner: 15
        }
    }).grow();
</script>
    

See also