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 »

Tooltips with a single value in the dataset aren't working


Posted by steve at 08:49 on Tuesday 22nd October 2024 [link]
Hi, I'd like to modify the tooltip on the pie chart


When you set up a single data, all mouse events, including tooltips, will not work.

Tooltips and mouse events are working well when there are multiple data.

Is there a way to fix it?

Thank you always.




Posted by Richard at 13:13 on Tuesday 22nd October 2024 [link]
I've come up with a work around - which I'll add in to the Pie chart library to make it transparent to the user (ie it works as expected!).

It just involves adding a really small value to you dataset - so small that the resulting segment is not interactive or even visible to the user.

Here's some code:

<script>
    val = 4;
    val2 = val / 1000000;

    new RGraph.Pie({
        id: 'cvs',
        data: [val,val2],
        options: {
            tooltips: 'A tooltip!: %{index}',
            tooltipsCss: {
                fontSize: '20pt'
            
        
    }).draw();
</script>

Posted by steve at 08:58 on Wednesday 23rd October 2024 [link]
As a result, there is no way to make tooltips work when it's a single data, unless it's a really small way to add a really small value?

Would you like to work on additional patches for the library?

Posted by Richard at 09:46 on Wednesday 23rd October 2024 [link]
Yes, I'm going to alter the Pie chart library so that it's seamless and you can use a single value the way you'd expect. All being well, this will be part of version 6.20.

Posted by Richard at 20:26 on Saturday 26th October 2024 [link]
OK I've added the patch to the Pie chart library and you can try it out by getting the updated Pie chart library from Github here:

https://raw.githubusercontent.com/heyesr/rgraph/refs/heads/main/libraries/RGraph.pie.js

Let me know how you get on with it.

[Replies are closed]