Skip to content

Commit

Permalink
fix: Refactor rendering order
Browse files Browse the repository at this point in the history
  • Loading branch information
mikaelkaron committed Apr 5, 2019
1 parent 1beabec commit 675934b
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/components/apex-chart/apex-chart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -107,16 +107,19 @@ export class chart {
return this.chartObj.updateOptions(newOptions, redrawPaths, animate);
}

componentDidLoad() {
componentWillLoad() {
if (this.chartObj === null) {
this.chartObj = new ApexCharts(
this.chartRef,
config(this.options, this.type, this.width, this.height, this.series)
);
return this.chartObj.render();
this.chartObj = new ApexCharts(
this.chartRef,
config(this.options, this.type, this.width, this.height, this.series)
);
}
}

async render() {
return this.chartObj.render();
}

componentDidUnload() {
if (this.chartObj !== null) {
this.chartObj.destroy();
Expand Down

0 comments on commit 675934b

Please sign in to comment.