newDataset.data.push(randomScalingFactor());
}
- window.myBar.addDataset(newDataset, 1);
+ barChartData.datasets.push(newDataset);
+ window.myBar.update();
updateLegend();
});
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();
});
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();
});
newDataset.data.push(randomScalingFactor());
}
- window.myLine.addDataset(newDataset);
+ config.data.datasets.push(newDataset);
+ window.myLine.update();
updateLegend();
});
);
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();
});
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();
});
</script>
newDataset.backgroundColor.push(randomColor(0.7));
}
- window.myDoughnut.addDataset(newDataset);
+ config.data.datasets.push(newDataset);
+ window.myDoughnut.update();
updateLegend();
});
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();
});
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();
});
</script>
newDataset.data.push(randomScalingFactor());
}
- window.myLine.addDataset(newDataset);
+ config.data.datasets.push(newDataset);
+ window.myLine.update();
updateLegend();
});
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();
});
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();
});
</script>
newDataset.data.push(randomScalingFactor());
}
- window.myLine.addDataset(newDataset);
+ config.data.datasets.push(newDataset);
+ window.myLine.update();
});
$('#addData').click(function() {
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();
});
</script>
</body>
newDataset.data.push(randomScalingFactor());
}
- window.myLine.addDataset(newDataset);
+ config.data.datasets.push(newDataset);
+ window.myLine.update();
updateLegend();
});
);
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();
});
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();
});
</script>
newDataset.data.push(randomScalingFactor());
}
- window.myLine.addDataset(newDataset);
+ config.data.datasets.push(newDataset);
+ window.myLine.update();
});
$('#addData').click(function() {
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();
});
</script>
</body>
newDataset.data.push(randomScalingFactor());
}
- window.myLine.addDataset(newDataset);
+ config.data.datasets.push(newDataset);
+ window.myLine.update();
updateLegend();
});
if (config.data.datasets.length > 0) {
config.data.labels.push('dataset #' + config.data.labels.length);
- for (var index = 0; index < config.data.datasets.length; ++index) {
- window.myLine.addData(randomScalingFactor(), index);
- }
+ $.each(config.data.datasets, function(i, dataset) {
+ dataset.data.push(randomScalingFactor());
+ });
+ window.myLine.update();
updateLegend();
}
});
$('#removeDataset').click(function() {
- window.myLine.removeDataset(0);
+ config.data.datasets.splice(0, 1);
+ window.myLine.update();
updateLegend();
});
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();
});
</script>
data: [randomScalingFactor(), randomScalingFactor(), randomScalingFactor(), randomScalingFactor(), randomScalingFactor()]
};
- window.myPie.addDataset(newDataset);
+ config.data.datasets.push(newDataset);
+ window.myPie.update();
});
$('#removeDataset').click(function() {
- window.myPie.removeDataset(0);
+ config.data.datasets.splice(0, 1);
+ window.myPie.update();
});
</script>
</body>
if (config.data.datasets.length > 0) {
config.data.labels.push('dataset #' + config.data.labels.length);
- for (var index = 0; index < config.data.datasets.length; ++index) {
- config.data.datasets[index].backgroundColor.push(randomColor());
- window.myPolarArea.addData(randomScalingFactor(), index);
- }
+ $.each(config.data.datasets, function(i, dataset) {
+ dataset.backgroundColor.push(randomColor());
+ dataset.data.push(randomScalingFactor());
+ });
+ window.myPolarArea.update();
updateLegend();
}
});
$('#removeData').click(function() {
- config.data.labels.splice(-1, 1); // remove the label first
+ config.data.labels.pop(); // remove the label first
- config.data.datasets.forEach(function(dataset, datasetIndex) {
- dataset.backgroundColor.splice(-1, 1);
- window.myPolarArea.removeData(datasetIndex, -1);
+ $.each(config.data.datasets, function(i, dataset) {
+ dataset.backgroundColor.pop();
+ dataset.data.pop();
});
+ window.myPolarArea.update();
updateLegend();
});
</script>
<button id="removeDataset">Remove Dataset</button>
<button id="addData">Add Data</button>
<button id="removeData">Remove Data</button>
- ]<div>
+ <div>
<h3>Legend</h3>
<div id="legendContainer">
newDataset.data.push(randomScalingFactor());
}
- window.myRadar.addDataset(newDataset);
+ config.data.datasets.push(newDataset);
+ window.myRadar.update();
updateLegend();
});
if (config.data.datasets.length > 0) {
config.data.labels.push('dataset #' + config.data.labels.length);
- for (var index = 0; index < config.data.datasets.length; ++index) {
- window.myRadar.addData(randomScalingFactor(), index);
- }
+ $.each(config.data.datasets, function (i, dataset) {
+ dataset.data.push(randomScalingFactor());
+ });
+ window.myRadar.update();
updateLegend();
}
});
$('#removeDataset').click(function() {
- window.myRadar.removeDataset(0);
+ config.data.datasets.splice(0, 1);
+ window.myRadar.update();
updateLegend();
});
$('#removeData').click(function() {
- config.data.labels.splice(-1, 1); // remove the label first
+ config.data.labels.pop(); // remove the label first
- config.data.datasets.forEach(function(dataset, datasetIndex) {
- window.myRadar.removeData(datasetIndex, -1);
+ $.each(config.data.datasets, function(i, dataset) {
+ dataset.data.pop();
});
+ window.myRadar.update();
updateLegend();
});
</script>