Home Forums Chart Support Animation is not working for graph

Animation is not working for graph

Viewing 2 posts - 1 through 2 (of 2 total)
  • #36148

    Link : http://demo-wordpress.hackerearth.com/rec-new/recruiter-survey-2021/#chapter1

    Code:
    var stud_developer_domains = new CanvasJS.Chart(“stud_developer_domains”, {
    title:{
    text: “My First Chart in CanvasJS”
    },
    data: [
    {
    // Change type to “doughnut”, “line”, “splineArea”, etc.
    type: “column”,
    dataPoints: [
    { label: “apple”, y: 10 },
    { label: “orange”, y: 15 },
    { label: “banana”, y: 25 },
    { label: “mango”, y: 30 },
    { label: “grape”, y: 28 }
    ]
    }
    ]
    });

    var elementid = document.getElementById(“stud_developer_domains”);
    var offsetForChartToDisplay = elementid.offsetTop + 150;
    function scrollFunction() {
    if( (document.documentElement.scrollTop+window.innerHeight) > offsetForChartToDisplay) {
    window.removeEventListener(“scroll”, scrollFunction);
    stud_developer_domains.render();
    }
    }
    window.addEventListener(“scroll”, scrollFunction)

    Animation on scroll down is not working. Please help me.

    #36157

    @usha,

    Based on the code shared by you, it seems like you have not set the animationEnabled property. Setting animationEnabled: true should work fine in your case


    Ranjitha R
    Team CanvasJS

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.