etElementById('removeDataset').addEventListener('click', function() {
            horizontalBarChartData.datasets.splice(0, 1);
            window.myHorizontalBar.update();
        });

        document.getElementById('removeData').addEventListener('click', function() {
            horizontalBarChartData.labels.splice(-1, 1); // remove the label first

            horizontalBarChartData.datasets.forEach(function (dataset, datasetIndex) {
                dataset.data.pop();
            });

     