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.