Procházet zdrojové kódy

fix: allow option to disable entry animation

pull/347/head
Shivam Mishra před 4 roky
committed by GitHub
rodič
revize
f145d6bbe9
1 změnil soubory, kde provedl 4 přidání a 1 odebrání
  1. +4
    -1
      src/js/charts/BaseChart.js

+ 4
- 1
src/js/charts/BaseChart.js Zobrazit soubor

@@ -38,6 +38,7 @@ export default class BaseChart {
showLegend: (typeof options.showLegend !== 'undefined') ? options.showLegend : 1,
isNavigable: options.isNavigable || 0,
animate: (typeof options.animate !== 'undefined') ? options.animate : 1,
disableEntryAnimation: options.disableEntryAnimation || 0,
truncateLegends: options.truncateLegends || 1
};

@@ -238,9 +239,11 @@ export default class BaseChart {
update(data, drawing = false) {
if (!data) console.error('No data to update.');
if (!drawing) data = deepClone(data);
const animate = drawing ? !this.config.disableEntryAnimation : this.config.animate;
this.data = this.prepareData(data);
this.calc(); // builds state
this.render(this.components, this.config.animate);
this.render(this.components, animate);
}

render(components = this.components, animate = true) {


Načítá se…
Zrušit
Uložit