drawChart () { this.emit('beforeDraw', this.window.Chart) if (this.chartConfig.options.plugins) { this.window.Chart.pluginService.register(this.chartConfig.options.plugins) } if (this.chartConfig.options.charts) { for (const chart of this.chartConfig.options.charts) { this.window.Chart.defaults[chart.type] = chart.defaults || {} if (chart.baseType) { this.window.Chart.controllers[chart.type] = this.window.Chart.controllers[chart.baseType].extend(chart.controller) } else { this.window.Chart.controllers[chart.type] = this.window.Chart.DatasetController.extend(chart.controller) } } } this._chart = this.window.Chart(this.ctx, this.chartConfig) return this }