fix: allow option to disable entry animation
This commit is contained in:
parent
b7f20aab15
commit
f145d6bbe9
@ -38,6 +38,7 @@ export default class BaseChart {
|
|||||||
showLegend: (typeof options.showLegend !== 'undefined') ? options.showLegend : 1,
|
showLegend: (typeof options.showLegend !== 'undefined') ? options.showLegend : 1,
|
||||||
isNavigable: options.isNavigable || 0,
|
isNavigable: options.isNavigable || 0,
|
||||||
animate: (typeof options.animate !== 'undefined') ? options.animate : 1,
|
animate: (typeof options.animate !== 'undefined') ? options.animate : 1,
|
||||||
|
disableEntryAnimation: options.disableEntryAnimation || 0,
|
||||||
truncateLegends: options.truncateLegends || 1
|
truncateLegends: options.truncateLegends || 1
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -238,9 +239,11 @@ export default class BaseChart {
|
|||||||
update(data, drawing = false) {
|
update(data, drawing = false) {
|
||||||
if (!data) console.error('No data to update.');
|
if (!data) console.error('No data to update.');
|
||||||
if (!drawing) data = deepClone(data);
|
if (!drawing) data = deepClone(data);
|
||||||
|
const animate = drawing ? !this.config.disableEntryAnimation : this.config.animate;
|
||||||
|
|
||||||
this.data = this.prepareData(data);
|
this.data = this.prepareData(data);
|
||||||
this.calc(); // builds state
|
this.calc(); // builds state
|
||||||
this.render(this.components, this.config.animate);
|
this.render(this.components, animate);
|
||||||
}
|
}
|
||||||
|
|
||||||
render(components = this.components, animate = true) {
|
render(components = this.components, animate = true) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user