Chartjs-Chartjs unexpected visual animation effect when adding data

0👍

You could try to first remove all labels and the data when switching to ‘last_30_days’.

if($date_range === 'last_30_days')
{
    scoreChart.data.labels = [];
    scoreChart.data.datasets[0].data = [];
    scoreChart.update({
      duration: 500,
      easing: 'easeInOutExpo'
    });

    updatedLabels = allLabels.slice(labelsCount - 30);
    updatedData = allData.slice(labelsCount - 30);
}

Leave a comment