Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[2.0.0-beta] Uncaught TypeError: easingFunction is not a function #1576

Closed
JamesDunne opened this issue Oct 26, 2015 · 10 comments
Closed

[2.0.0-beta] Uncaught TypeError: easingFunction is not a function #1576

JamesDunne opened this issue Oct 26, 2015 · 10 comments

Comments

@JamesDunne
Copy link

Uncaught TypeError: easingFunction is not a function
animation.render @ Chart-2.0.0-beta.js:1411
Chart.animationService.startDigest @ Chart-2.0.0-beta.js:1157
Chart.animationService.digestWrapper @ Chart-2.0.0-beta.js:1135

This happens on mousemove events after being rendered. Animation is disabled via options.

Client code to render is:

new Chart.Line(ctx, {
    data: {
        labels:   dates,
        datasets: [{
            label: "values",
            data:  values
        }]
    },
    options: {
        animation:               false,
        datasetFill:             false,
        pointHitDetectionRadius: 4
    }
});
@JamesDunne
Copy link
Author

I ported this code from 1.0 not realizing the difference in options. Setting animation to a bool whereas the library expects a more complex object is what's causing the failure here.

@etimberg
Copy link
Member

etimberg commented Dec 5, 2015

Fixed in #1743

If options.animation is set to false no animation will take place.

@etimberg etimberg closed this as completed Dec 5, 2015
@WhitecastlePT
Copy link

Sooooo i'm in 2.4.0 and this still happens...So we can´t have animations now ?

@pietrofxq
Copy link

Having the same issue. Running version 2.4.0 as well.

@etimberg
Copy link
Member

@WhitecastlePT @pietrofxq animations work fine in 2.4.0. Do you have a specific test case that does not work?

@pietrofxq
Copy link

@etimberg Looks like animation is working, but explicit setting animation:true for the chart options gives this error

@etimberg
Copy link
Member

oh, that makes sense because in the default config, animation is an object

@WhitecastlePT
Copy link

@etimberg @pietrofxq i reached the same conclusion after your input...

@jamespsterling
Copy link

Fixed this by doing animation block,

var pieOptions = {
    ...
    animation: {
        steps: 50,
        easing: "easeOut",
        rotate: true,
        scale: false
    },
    responsive: true,
   ...
};

@jimfilippou
Copy link

jimfilippou commented Jul 2, 2018

Assuming you want a line chart, use this configuration 🔨

{
	steps: 50,
	scale: false
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants