There is a way to do it.
First, open the plugin’s wordpress_charts_js.php in the plugin’s folder.
The first function is to register scripts.
It should look like this:
// Register plugin Scripts
wp_register_script( ‘wp-chart-functions’, plugins_url(‘/js/waypoint.js’, __FILE__),’jquery’,”, true );
wp_register_script( ‘charts-js’, plugins_url(‘/js/Chart.min.js’, __FILE__) );
wp_register_script( ‘wp-chart-functions’, plugins_url(‘/js/functions.js’, __FILE__),’jquery’,”, true );
// Enqeue those suckers
wp_enqueue_script( ‘waypoint’ );
wp_enqueue_script( ‘charts-js’ );
wp_enqueue_script( ‘wp-chart-functions’ );
Basically, what we did is add a reference to a library called “Waypoint” Obviously, you’ll need to place waypoint.js in the wp-charts/js for this to work.
Then, you’ll need to judge where you need to insert the “hack” but for my situation, i needed to animate the graphs once they were in view.
So I did this:
function wp_charts_shortcode( $atts ) {
…
…
…
…
$currentchart .= ‘$(“.wp_charts_canvas”).waypoint({
offset: “bottom-in-view”,
triggerOnce: true,
handler : function(direction){
var wpChart’.$title.$type.’ = new Chart(document.getElementById(“‘.$title.'”).getContext(“2d”)).’.$type.'(‘.$title.’Data,’.$title.’Ops);
}
});
</script>’;
}
—————————————————-
Basically, instead of creating the graph directly, I return the JS that will initialize the graph using waypoint.
good luck.