.push not pushing Chartjs datas and not updating

Viewed 30

Can someone figure out why my data do not push and do not update my chart? When I am doing, nineChart2.data.datasets[1].data.dps.push I am having an error. Here is my chartJs code:

            fill: false,
            label: '1',
            label: ["Duty Point 1"],
            backgroundColor: 'blue',
            borderColor: 'blue',
            borderWidth: 1,
            showLine: false,
            pointStyle: 'triangle',
            data: [{
                // x: randomizer6.value,
                // y: randomizer61.value
                dataPoints: dps                     

and here is my function code:

function interactivePoints() {
    // updatingPoints = [randomizer6.value, randomizer61.value];
    // nineChart2.data.datasets[1].data = updatingPoints;
    xValue = document.getElementById('randomizer6').value;
    yValue = document.getElementById('randomizer61').value;
    dps.push({
                x: xValue,
                y: yValue
            });
    console.log(dps)
    // nineChart2.update();
    nineChart2.render();
}

When I am only using .push, it reads my X and Y but do not update my chart

0 Answers
Related