I need to treat the API result so that I don’t receive values less than 0, I’ve been trying this way and so far I haven’t been able to:
private handleChart(data: Object): void {
const series = [];
for (const [key, value] of Object.entries(data)) {
series.push({
name: key,
data: value,
type: "line",
});
}
if (series[0].data.length < 0) {
delete series[0].data;
}
console.log(data );
this.plotChart(series);
}
Original code:
private handleChart(data: Object): void {
const series = [];
for (const [key, value] of Object.entries(data)) {
series.push({
name: key,
data: value,
type: "line",
});
}
this.plotChart(series);
}