kendo angular chart does not draw when array is pushed to the datasource

Viewed 61

I can see my array in the console when i log it,but it does not draw the chart here is the chart:

  <kendo-chart>
  <kendo-chart-title text="Units sold"></kendo-chart-title>
  <kendo-chart-series>    
    <kendo-chart-series-item type="line" [data]="seriesData">
    </kendo-chart-series-item>
  </kendo-chart-series>
</kendo-chart>

here is component:

 public seriesData: number[][]=[] ;
  public x:number[][]=[];

the following works and draws a chart:

this. seriesData = [
    [16.4, 7], [21.7, 9], [25.4, 5], [19, 2]
];

but the following does not work:

  this.x=[
  [5,4],[3,6]
      ]
      this. seriesData.push(this.x);
1 Answers

Demo use this

this. seriesData = [ [16.4, 7], [21.7, 9], [25.4, 5], [19, 2] ];
this.x=[[5,4],[3,6] ];
this. seriesData=this. seriesData.concat(this.x);
Related