Compare commits

...

2 Commits

Author SHA1 Message Date
Andrew Henry
9a5f8ce82f Merge branch 'release/2.0.5' into plots-fix-initialize 2022-07-07 19:38:04 -07:00
Joshi
4a4d6a1038 Initialize the plot only after the chart is ready 2022-06-29 18:56:41 -07:00
2 changed files with 2 additions and 5 deletions

View File

@@ -87,6 +87,7 @@
:highlights="highlights" :highlights="highlights"
:show-limit-line-labels="showLimitLineLabels" :show-limit-line-labels="showLimitLineLabels"
@plotReinitializeCanvas="initCanvas" @plotReinitializeCanvas="initCanvas"
@chartLoaded="initialize"
/> />
</div> </div>
@@ -359,11 +360,6 @@ export default {
this.setTimeContext(); this.setTimeContext();
this.loaded = true; this.loaded = true;
//We're referencing the canvas elements from the mct-chart in the initialize method.
// So we need $nextTick to ensure the component is fully mounted before we can initialize stuff.
this.$nextTick(this.initialize);
}, },
beforeDestroy() { beforeDestroy() {
document.removeEventListener('keydown', this.handleKeyDown); document.removeEventListener('keydown', this.handleKeyDown);

View File

@@ -115,6 +115,7 @@ export default {
this.listenTo(this.config.yAxis, 'change', this.updateLimitsAndDraw); this.listenTo(this.config.yAxis, 'change', this.updateLimitsAndDraw);
this.listenTo(this.config.xAxis, 'change', this.updateLimitsAndDraw); this.listenTo(this.config.xAxis, 'change', this.updateLimitsAndDraw);
this.config.series.forEach(this.onSeriesAdd, this); this.config.series.forEach(this.onSeriesAdd, this);
this.$emit('chartLoaded');
}, },
beforeDestroy() { beforeDestroy() {
this.destroy(); this.destroy();