diff --git a/samples/bar.html b/samples/bar.html
index 526fd8e5a..bb8c884c7 100644
--- a/samples/bar.html
+++ b/samples/bar.html
@@ -106,7 +106,8 @@
newDataset.data.push(randomScalingFactor());
}
- window.myBar.addDataset(newDataset, 1);
+ barChartData.datasets.push(newDataset);
+ window.myBar.update();
updateLegend();
});
@@ -115,15 +116,18 @@
barChartData.labels.push('data #' + barChartData.labels.length);
for (var index = 0; index < barChartData.datasets.length; ++index) {
- window.myBar.addData(randomScalingFactor(), index);
+ //window.myBar.addData(randomScalingFactor(), index);
+ barChartData.datasets[index].data.push(randomScalingFactor());
}
+ window.myBar.update();
updateLegend();
}
});
$('#removeDataset').click(function() {
- window.myBar.removeDataset(0);
+ barChartData.datasets.splice(0, 1);
+ window.myBar.update();
updateLegend();
});
@@ -131,8 +135,10 @@
barChartData.labels.splice(-1, 1); // remove the label first
barChartData.datasets.forEach(function(dataset, datasetIndex) {
- window.myBar.removeData(datasetIndex, -1);
+ dataset.data.pop();
});
+
+ window.myBar.update();
updateLegend();
});
diff --git a/samples/combo-time-scale.html b/samples/combo-time-scale.html
index 548202e2c..081683eed 100644
--- a/samples/combo-time-scale.html
+++ b/samples/combo-time-scale.html
@@ -145,7 +145,8 @@
newDataset.data.push(randomScalingFactor());
}
- window.myLine.addDataset(newDataset);
+ config.data.datasets.push(newDataset);
+ window.myLine.update();
updateLegend();
});
@@ -157,15 +158,17 @@
);
for (var index = 0; index < config.data.datasets.length; ++index) {
- window.myLine.addData(randomScalingFactor(), index);
+ config.data.datasets[index].data.push(randomScalingFactor());
}
+ window.myLine.update();
updateLegend();
}
});
$('#removeDataset').click(function() {
- window.myLine.removeDataset(0);
+ config.data.datasets.splice(0, 1);
+ window.myLine.update();
updateLegend();
});
@@ -173,9 +176,10 @@
config.data.labels.splice(-1, 1); // remove the label first
config.data.datasets.forEach(function(dataset, datasetIndex) {
- window.myLine.removeData(datasetIndex, -1);
+ config.data.datasets[datasetIndex].data.pop();
});
+ window.myLine.update();
updateLegend();
});
diff --git a/samples/doughnut.html b/samples/doughnut.html
index ae6bbc9e5..728c8847a 100644
--- a/samples/doughnut.html
+++ b/samples/doughnut.html
@@ -144,7 +144,8 @@
newDataset.backgroundColor.push(randomColor(0.7));
}
- window.myDoughnut.addDataset(newDataset);
+ config.data.datasets.push(newDataset);
+ window.myDoughnut.update();
updateLegend();
});
@@ -153,15 +154,18 @@
config.data.labels.push('data #' + config.data.labels.length);
$.each(config.data.datasets, function(index, dataset) {
- window.myDoughnut.addData(randomScalingFactor(), index, dataset.data.length, randomColor(0.7));
+ dataset.data.push(randomScalingFactor());
+ dataset.backgroundColor.push(randomColor(0.7));
});
+ window.myDoughnut.update();
updateLegend();
}
});
$('#removeDataset').click(function() {
- window.myDoughnut.removeDataset(0);
+ config.data.datasets.splice(0, 1);
+ window.myDoughnut.update();
updateLegend();
});
@@ -169,9 +173,11 @@
config.data.labels.splice(-1, 1); // remove the label first
config.data.datasets.forEach(function(dataset, datasetIndex) {
- window.myDoughnut.removeData(datasetIndex, -1);
+ dataset.data.pop();
+ dataset.backgroundColor.pop();
});
+ window.myDoughnut.update();
updateLegend();
});
diff --git a/samples/line-logarithmic.html b/samples/line-logarithmic.html
index 21159e6ee..613499010 100644
--- a/samples/line-logarithmic.html
+++ b/samples/line-logarithmic.html
@@ -126,7 +126,8 @@
newDataset.data.push(randomScalingFactor());
}
- window.myLine.addDataset(newDataset);
+ config.data.datasets.push(newDataset);
+ window.myLine.update();
updateLegend();
});
@@ -135,15 +136,17 @@
config.data.labels.push('dataset #' + config.data.labels.length);
for (var index = 0; index < config.data.datasets.length; ++index) {
- window.myLine.addData(randomScalingFactor(), index);
+ config.data.datasets[index].data.push(randomScalingFactor());
}
+ window.myLine.update();
updateLegend();
}
});
$('#removeDataset').click(function() {
- window.myLine.removeDataset(0);
+ config.data.datasets.splice(0, 1);
+ window.myLine.update();
updateLegend();
});
@@ -151,9 +154,10 @@
config.data.labels.splice(-1, 1); // remove the label first
config.data.datasets.forEach(function(dataset, datasetIndex) {
- window.myLine.removeData(datasetIndex, -1);
+ dataset.data.pop();
});
+ window.myLine.update();
updateLegend();
});
diff --git a/samples/line-scale-override.html b/samples/line-scale-override.html
index 6603b5c04..a92b14a1b 100644
--- a/samples/line-scale-override.html
+++ b/samples/line-scale-override.html
@@ -101,7 +101,8 @@
newDataset.data.push(randomScalingFactor());
}
- window.myLine.addDataset(newDataset);
+ config.data.datasets.push(newDataset);
+ window.myLine.update();
});
$('#addData').click(function() {
@@ -109,21 +110,26 @@
config.data.labels.push('dataset #' + config.data.labels.length);
for (var index = 0; index < config.data.datasets.length; ++index) {
- window.myLine.addData(randomScalingFactor(), index);
+ config.data.datasets[index].data.push(randomScalingFactor());
}
+
+ window.myLine.update();
}
});
$('#removeDataset').click(function() {
- window.myLine.removeDataset(0);
+ config.data.datasets.splice(0, 1);
+ window.myLine.update();
});
$('#removeData').click(function() {
config.data.labels.splice(-1, 1); // remove the label first
config.data.datasets.forEach(function(dataset, datasetIndex) {
- window.myLine.removeData(datasetIndex, -1);
+ dataset.data.pop();
});
+
+ window.myLine.update();
});