I am facing an issue with pushing data to the "data" property in the object named "decData".
var decData = {
labels: [],
datasets: [
{
fillColor: "rgba(151,187,205,0.5)",
strokeColor: "rgba(151,187,205,1)",
data: []
}
]
}
The code I have tried is not working as expected.
decData.datasets.data.push(dayProfit);
Can anyone help me figure out what mistake I might be making? The error message I am getting is:
Uncaught TypeError: Cannot call method 'push' of undefined