
            window.myHorizontalBar.update();
        });

        var colorNames = Object.keys(window.chartColors);

        document.getElementById('addDataset').addEventListener('click', function() {
            var colorName = colorNames[horizontalBarChartData.datasets.length % colorNames.length];;
            var dsColor = window.chartColors[colorName];
            var newDataset = {
                label: 'Dataset ' + horizontalBarChartData.datasets.length,
                backgroundColor: 