Pārlūkot izejas kodu

fix: allow option to disable entry animation

pull/347/head
Shivam Mishra pirms 4 gadiem
committed by GitHub
vecāks
revīzija
f145d6bbe9
1 mainītis faili ar 4 papildinājumiem un 1 dzēšanām
  1. +4
    -1
      src/js/charts/BaseChart.js

+ 4
- 1
src/js/charts/BaseChart.js Parādīt failu

@@ -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) {


Notiek ielāde…
Atcelt
Saglabāt