Skip to content

Commit

Permalink
Fix For Adding And Removing Datasets For Bar Samples
Browse files Browse the repository at this point in the history
Fix for chartjs#5662
  • Loading branch information
TPullen21 committed Aug 6, 2018
1 parent 3010173 commit a9164f3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions samples/charts/bar/horizontal.html
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@
var colorName = colorNames[horizontalBarChartData.datasets.length % colorNames.length];
var dsColor = window.chartColors[colorName];
var newDataset = {
label: 'Dataset ' + horizontalBarChartData.datasets.length,
label: 'Dataset ' + (horizontalBarChartData.datasets.length + 1),
backgroundColor: color(dsColor).alpha(0.5).rgbString(),
borderColor: dsColor,
data: []
Expand Down Expand Up @@ -130,7 +130,7 @@
});

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

Expand Down
4 changes: 2 additions & 2 deletions samples/charts/bar/vertical.html
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
var colorName = colorNames[barChartData.datasets.length % colorNames.length];
var dsColor = window.chartColors[colorName];
var newDataset = {
label: 'Dataset ' + barChartData.datasets.length,
label: 'Dataset ' + (barChartData.datasets.length + 1),
backgroundColor: color(dsColor).alpha(0.5).rgbString(),
borderColor: dsColor,
borderWidth: 1,
Expand Down Expand Up @@ -125,7 +125,7 @@
});

document.getElementById('removeDataset').addEventListener('click', function() {
barChartData.datasets.splice(0, 1);
barChartData.datasets.pop();
window.myBar.update();
});

Expand Down

0 comments on commit a9164f3

Please sign in to comment.