瀏覽代碼

Merge pull request #330 from helge79/master

Render legend after update, fixes #329
tags/v1.5.8
Shivam Mishra 4 年之前
committed by GitHub
父節點
當前提交
85d7e609c8
沒有發現已知的金鑰在資料庫的簽署中 GPG Key ID: 4AEE18F83AFDEB23
共有 1 個文件被更改,包括 3 次插入2 次删除
  1. +3
    -2
      src/js/charts/BaseChart.js

+ 3
- 2
src/js/charts/BaseChart.js 查看文件

@@ -6,12 +6,12 @@ import { BASE_MEASURES, getExtraHeight, getExtraWidth, getTopOffset, getLeftOffs
import { getColor, isValidColor } from '../utils/colors'; import { getColor, isValidColor } from '../utils/colors';
import { runSMILAnimation } from '../utils/animation'; import { runSMILAnimation } from '../utils/animation';
import { downloadFile, prepareForExport } from '../utils/export'; import { downloadFile, prepareForExport } from '../utils/export';
import { deepClone } from '../utils/helpers'
import { deepClone } from '../utils/helpers';


export default class BaseChart { export default class BaseChart {
constructor(parent, options) { constructor(parent, options) {
// deepclone options to avoid making changes to orignal object // deepclone options to avoid making changes to orignal object
options = deepClone(options)
options = deepClone(options);


this.parent = typeof parent === 'string' this.parent = typeof parent === 'string'
? document.querySelector(parent) ? document.querySelector(parent)
@@ -233,6 +233,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.components, this.config.animate); this.render(this.components, this.config.animate);
this.renderLegend();
} }


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


Loading…
取消
儲存