
''' getMyChart_OneHourdata(data) { data.forEach(el => { for (let key in el) { if (key == "dataset") this.lastOneHourDataValues = el[key]
}})
console.log("lastonehr",this.lastOneHourDataValues)
for (const value of this.lastOneHourDataValues) {
console.log(value)
for(const val of value)
{
this.lastonehrtimestamp.push(val.x)
this.lastonehrdatavalues.push(val.y)
}
};
console.log(" this.lastonehrdatavalues", this.lastonehrdatavalues)
console.log("this.lastonehrtimestamp", this.lastonehrtimestamp)
const ctx = document.getElementById('SDSPOneChart');
console.log("ctx", ctx)
console.log("last1hrdata", data)
const sdsPOneChart = new Chart(ctx, {
type: 'line',
data: {
labels: [this.lastonehrtimestamp],
datasets: [{
label: 'SDS_P1',
data: [this.lastonehrdatavalues],
backgroundColor: ['Orange'],
borderColor: 'rgb(75, 192, 192)',
tension: 0
}],
},
options: {
responsive: true,
maintainAspectRatio: true,
scales: {
x: {
beginAtZero: true
}
}
}
});
console.log("CurrentSDSP1_P2", sdsPOneChart)
}
'''
Am i doing something wrong here. Do i need to configure x-axis?