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.


16th June, Rachel
I have a question about the 3D Bar chart
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?


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 »

The drawing API

Introduction

The RGraph Drawing api allows you to add various elements to your charts. These elements allow you to extend both the interactivity and the information presented on your charts by adding shapes to them. The elements that are available have a very similar structure to a chart library - you create and manipulate them in the same way. As well as this they support similar interactive properties - such as tooltips, the click event and the mousemove event. This makes them very useful for providing your users with extra information - much like tooltips do by themselves - and also highlighting areas on the chart.

Example usage of the drawing api is as follows:

<script>
    line = new RGraph.Line({
        id: 'cvs',
        data: [4,9,1,3,2,6,5],
        options: {
            xaxisLabels: ['Monday','Tuesday','Wednesday','Thursday','Friday','Saturday','Sunday'],
            marginInner: 5,
            tickmarksStyle: 'endcircle',
            marginBottom: 45,
            colors: ['black'],
            yaxisScale: false,
            textSize: 14
        }
    }).draw();
    
    marker1 = new RGraph.Drawing.Marker1({
        id: 'cvs',
        x: line.coords[3][0],
        y: line.coords[3][1],
        radius: 15,
        text: 'W',
        options: {
            tooltips: [
                '<b>Winner!</b><br />Mark sold by far the most' +
                'widgets and as a result is the winner!'
            ],
            highlightFill: 'rgba(255,0,0,0.7)'
        }
    }).draw();
    
    circle = new RGraph.Drawing.Circle({
        id: 'cvs',
        x: line.coords[2][0],
        y: line.coords[2][1], 15,
        radius: 20,
        options: {
            colorsStroke: 'black',
            colorsFill: 'rgba(255,0,0,0.7)',
            events: {
                click:,function (e, shape)
                {
                    alert('[NOTICE] Also worthy of note is the low point of the competition - which was wednesday')
                },
                mousemove: function (e, shape)
                {
                    e.target.style.cursor = 'pointer';
                }
            }
        }
    }).draw();


    image = new RGraph.Drawing.Image({
        id: 'cvs',
        x: line.get('marginLeft') + 5,
        y: line.canvas.height - line.get('marginBottom') - 5,
        src: '/images/logo.png',
        options: {
            valign: 'bottom',
            tooltips: [
                '<b>Information</b><br />The image drawing object could be ' +
                'used as a method of<br />' +
                'providing more information to your users.'
            ],
            tooltipsEvent: 'onclick'
        }
    }).draw();
</script>

Available drawing API objects