I'm not sure how I can push data to the "data" property within "decData".
var decData = {
labels: [],
datasets: [
{
fillColor: "rgba(151,187,205,0.5)",
strokeColor: "rgba(151,187,205,1)",
data: []
}
]
}
Here is the code I'm using that isn't working
decData.datasets.data.push(dayProfit);
Could anyone tell me what I'm doing wrong? The error is
Uncaught TypeError: Cannot call method 'push' of undefined
decData.datasets[0].data.push(dayProfit)since datasets is an array.