浏览代码

fix: allow option to disable entry animation

pull/347/head
Shivam Mishra 4 年前
committed by GitHub
父节点
当前提交
f145d6bbe9
共有 1 个文件被更改,包括 4 次插入1 次删除
  1. +4
    -1
      src/js/charts/BaseChart.js

+ 4
- 1
src/js/charts/BaseChart.js 查看文件

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


正在加载...
取消
保存