π:0
You should place the chart creation code inside the method ngAfterViewInit
and donβt forget to specify the chart type
.
export class EchartsDropdownComponent implements AfterViewInit, OnChanges {
ngAfterViewInit() {
myChart = new Chart('myChart', {
type: 'scatter', // <- define the chart type
data: {
datasets: [{
label: 'Scatter Dataset',
...
}