[Chartjs]-Ng2-Charts Linechart only showing first 2 two values

9👍

labels property must be defined along with values. According to documentation for properties:

labels (?Array) – x axis labels. It’s necessary for charts: line, bar and radar.

So specifying actual values for labels will do the trick.

1👍

You need to put a condition inside the canvas, e.g., show it when the data is loaded or your array.length > 0

Example:

<canvas baseChart *ngIf="showMyChart" [datasets]="_numbers"
     [chartType]="_chartType" width="600px">
</canvas>

Leave a comment