1

I want to declare an empty line chart or clear the line chart data by simply emptying the chart data array. With this line of code in typescript:

<!--HTML-->
<ngx-charts-line-chart ...
    [results]="multi">
</ngx-charts-line-chart>

//typescript
this.multi =[];

However Error: <rect> attribute x: Expected length, "NaN". occurred before I push data(or let say renew the data array with actual data inside) into the declared empty array or after I empty the data inside the data array.

Is there any way to make this error disappear? Thanks in advance.

AkiZukiLenn
  • 337
  • 3
  • 14

1 Answers1

1

Yes I have find a work around in typescript. Declare the object like this works in my case.

multi:any[]=[];
AkiZukiLenn
  • 337
  • 3
  • 14