mendixlabs / ChartJS

A Mendix widget that wraps the ChartJS library.
https://appstore.home.mendix.com/link/app/1712/Mendix/ChartJS-Widget
Apache License 2.0
4 stars 28 forks source link

Chart Animation Rendering stucks #73

Closed Andries-Smit closed 8 years ago

Andries-Smit commented 8 years ago

Having Multiple Graphs on one page. The rendering works most of the time fine... however sometimes it stops the animation before it is finished.

image

The option "Responsive animation rendering" is set to 0

JelteMX commented 8 years ago

That's weird, because it shouldnt animate when this is set to 0. In which Modeler version does this occur?

Andries-Smit commented 8 years ago

Mendix 6.3.1

Note that. It is a Data View containing 6 graphs, that listens to a List View.

2016-04-01 10:26 GMT+02:00 Jelte Lagendijk notifications@github.com:

That's weird, because it shouldnt animate when this is set to 0. In which Modeler version does this occur?

— You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub https://github.com/mendix/ChartJS/issues/73#issuecomment-204306425

Andries-Smit commented 8 years ago

It could well be that there is an refresh/interrupt during the animation.

renderstackbargraph

https://github.com/mendix/ChartJS/blob/master/src/ChartJS/widgets/StackedBarChart/widget/StackedBarChart.js#L146

responsiveAnimationDuration, is is not used for global animations

However the option animation does, but is not configurable.

Would be nice feature to add.

JelteMX commented 8 years ago

the option animation cannot be set to false (as in Chart.JS version 1), but I managed to set the animation duration to 0. I tested today with 10 charts on one page, responsiveAnimationDuration to 0 and animation duration to 0, and that seems to do the trick

Andries-Smit commented 8 years ago

Animations are still moving...

The sugested fix, is global and not function in my case, not sure why

Core.js:

if (!this.chartAnimation) {
    this._chartJS.defaults.global.animation.duration = 0;
}

A better solution will probably by setting it as an option in the individual charts

BarChart.js

options: this._chartOptions({
     animation:  this.chartAnimation,

This should be applied to all type of charts....

JelteMX commented 8 years ago

@Andries-Smit I was already one step ahead of you in the upcoming v3.5.0 release ;-)

https://github.com/mendix/ChartJS/blob/master/src/ChartJS/widgets/Core.js#L575

                animation: {
                    duration: this.chartAnimation ? this.animationDuration : 0
                }

As fixed in these commits: 4963660 & e6d8c2b