feat: allow disabling animations using 'animate' option

This commit is contained in:
Shivam Mishra 2019-09-01 17:25:53 +05:30
parent 317136eec4
commit 2c3d8a52f2

View File

@ -32,7 +32,7 @@ export default class BaseChart {
showTooltip: 1, // calculate showTooltip: 1, // calculate
showLegend: 1, // calculate showLegend: 1, // calculate
isNavigable: options.isNavigable || 0, isNavigable: options.isNavigable || 0,
animate: 1, animate: (typeof options.animate !== 'undefined') ? options.animate : 1,
truncateLegends: options.truncateLegends || 0 truncateLegends: options.truncateLegends || 0
}; };
@ -225,7 +225,7 @@ export default class BaseChart {
} }
this.data = this.prepareData(data); this.data = this.prepareData(data);
this.calc(); // builds state this.calc(); // builds state
this.render(); this.render(this.components, this.config.animate);
} }
render(components=this.components, animate=true) { render(components=this.components, animate=true) {