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 now closed]