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

More »

 

New datagrid in v6.21
In version 6.21 a new datagrid object has been added. This makes it easy to add static or dynamic data tables to your pages. It can be used whether you use the canvas or SVG libraries or entirely standalone.

Read more »

 

Download
Get the latest version of RGraph (version 6.21, 10th April 2025) 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 »

 

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 »

How do I change a property after the animation ends?


Posted by AKN at 13:27 on Friday 3rd February 2023 [link]
Hey, how can I make it so when the initial grow animation labelsAbove is set to false and when animation finishes labelsAbove is true? I've tried like this but didn't seem to work.

const chart = new RGraph.Bipolar({
    id: tempCVSID,
    left: leftArr,
    right: rightArr,
    options: {
        labelsAbove: false,
    }
}).grow({ frames: 100 }).animate({
    labelsAbove: true,
})

Posted by Richard at 17:41 on Friday 3rd February 2023 [link]
For that you can use the callback function which, from memory, looks like this:

const chart = new RGraph.Bipolar({
    id: tempCVSID,
    left: leftArr,
    right: rightArr,
    options: {
        labelsAbove: false,
    }
}).grow({ frames: 100}, function (obj)
{
    obj.set('labelsAbove', true);
    RGraph.redraw();
})

Posted by AKN at 17:47 on Friday 3rd February 2023 [link]
It worked thank you!

[Replies are closed]