From: Evert Timberg
Date: Wed, 20 May 2015 13:03:22 +0000 (-0400)
Subject: Merge remote-tracking branch 'upstream/v2.0-dev' into feature/v2.0dev-xy
X-Git-Tag: v2.0-alpha~8^2~11
X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=12e2ace03904ac07a8929f34884892b74d14c2fa;p=thirdparty%2FChart.js.git
Merge remote-tracking branch 'upstream/v2.0-dev' into feature/v2.0dev-xy
Conflicts:
src/Chart.Core.js
Fixed the sample files & chart type initialize methods so that this.data does not get set to undefined.
---
12e2ace03904ac07a8929f34884892b74d14c2fa
diff --cc samples/bar.html
index eea5b659b,8b0f1e942..b0f82cf1b
--- a/samples/bar.html
+++ b/samples/bar.html
@@@ -30,26 -30,38 +30,41 @@@
label: 'Dataset 2',
backgroundColor: "rgba(151,187,205,0.5)",
data: [randomScalingFactor(), randomScalingFactor(), randomScalingFactor(), randomScalingFactor(), randomScalingFactor(), randomScalingFactor(), randomScalingFactor()]
+ }, {
+ label: 'Dataset 3',
+ backgroundColor: "rgba(151,187,205,0.5)",
+ data: [randomScalingFactor(), randomScalingFactor(), randomScalingFactor(), randomScalingFactor(), randomScalingFactor(), randomScalingFactor(), randomScalingFactor()]
+ }, {
+ label: 'Dataset 4',
+ backgroundColor: "rgba(151,187,205,0.5)",
+ data: [randomScalingFactor(), randomScalingFactor(), randomScalingFactor(), randomScalingFactor(), randomScalingFactor(), randomScalingFactor(), randomScalingFactor()]
+ }, {
+ label: 'Dataset 3',
+ backgroundColor: "rgba(151,187,205,0.5)",
+ data: [randomScalingFactor(), randomScalingFactor(), randomScalingFactor(), randomScalingFactor(), randomScalingFactor(), randomScalingFactor(), randomScalingFactor()]
}]
- }
+ };
window.onload = function() {
var ctx = document.getElementById("canvas").getContext("2d");
-- window.myBar = new Chart(ctx).Bar(barChartData, {
-- responsive: true,
-- hoverMode: 'label',
-- scaleBeginAtZero: false,
- hoverAnimationDuration: 400
- hoverAnimationDuration: 400,
- stacked: true,
++ window.myBar = new Chart(ctx).Bar({
++ data: barChartData,
++ options: {
++ responsive: true,
++ hoverMode: 'label',
++ scaleBeginAtZero: false,
++ hoverAnimationDuration: 400,
++ stacked: true,
++ }
});
- }
+ };
$('#randomizeData').click(function() {
- barChartData.datasets[0].backgroundColor = 'rgba(' + randomColorFactor() + ',' + randomColorFactor() + ',' + randomColorFactor() + ',.7)';
- barChartData.datasets[0].data = [randomScalingFactor(), randomScalingFactor(), randomScalingFactor(), randomScalingFactor(), randomScalingFactor(), randomScalingFactor(), randomScalingFactor()];
-
- barChartData.datasets[1].backgroundColor = 'rgba(' + randomColorFactor() + ',' + randomColorFactor() + ',' + randomColorFactor() + ',.7)';
- barChartData.datasets[1].data = [randomScalingFactor(), randomScalingFactor(), randomScalingFactor(), randomScalingFactor(), randomScalingFactor(), randomScalingFactor(), randomScalingFactor()];
+ $.each(barChartData.datasets, function(i, dataset) {
+ dataset.backgroundColor = 'rgba(' + randomColorFactor() + ',' + randomColorFactor() + ',' + randomColorFactor() + ',.7)';
+ dataset.data = [randomScalingFactor(), randomScalingFactor(), randomScalingFactor(), randomScalingFactor(), randomScalingFactor(), randomScalingFactor(), randomScalingFactor()];
+ });
window.myBar.update();
});
diff --cc samples/doughnut.color.html
index 5457fd094,5457fd094..f61c25db3
--- a/samples/doughnut.color.html
+++ b/samples/doughnut.color.html
@@@ -48,7 -48,7 +48,12 @@@
window.onload = function(){
var ctx = document.getElementById("chart-area").getContext("2d");
-- window.myDoughnut = new Chart(ctx).Doughnut(doughnutData, {responsive : true});
++ window.myDoughnut = new Chart(ctx).Doughnut({
++ data: doughnutData,
++ options: {
++ responsive : true
++ }
++ });
};
diff --cc samples/doughnut.html
index 19c6a6d0c,19c6a6d0c..4a5860e30
--- a/samples/doughnut.html
+++ b/samples/doughnut.html
@@@ -58,8 -58,8 +58,11 @@@
window.onload = function() {
var ctx = document.getElementById("chart-area").getContext("2d");
-- window.myDoughnut = new Chart(ctx).Doughnut(doughnutData, {
-- responsive: true
++ window.myDoughnut = new Chart(ctx).Doughnut({
++ data: doughnutData,
++ options: {
++ responsive: true
++ }
});
};
diff --cc samples/line-customTooltips.html
index 4dc46e1ab,4dc46e1ab..a9ee1b85c
--- a/samples/line-customTooltips.html
+++ b/samples/line-customTooltips.html
@@@ -112,10 -112,10 +112,13 @@@
window.onload = function() {
var ctx1 = document.getElementById("chart1").getContext("2d");
-- window.myLine = new Chart(ctx1).Line(lineChartData, {
-- showScale: false,
-- pointDot : true,
-- responsive: true
++ window.myLine = new Chart(ctx1).Line({
++ data: lineChartData,
++ options: {
++ showScale: false,
++ pointDot : true,
++ responsive: true
++ }
});
var ctx2 = document.getElementById("chart2").getContext("2d");
diff --cc samples/line.html
index b6c2ae8e7,eac9b32fe..970c66c12
--- a/samples/line.html
+++ b/samples/line.html
@@@ -45,9 -45,10 +45,13 @@@
window.onload = function() {
var ctx = document.getElementById("canvas").getContext("2d");
-- window.myLine = new Chart(ctx).Line(lineChartData, {
-- responsive: true,
- hoverMode: 'label'
- hoverMode: 'label',
- stacked: true
++ window.myLine = new Chart(ctx).Line({
++ data: lineChartData,
++ options: {
++ responsive: true,
++ hoverMode: 'label',
++ stacked: true
++ }
});
};
diff --cc samples/pie-customTooltips.html
index 732317de4,732317de4..37075ecbb
--- a/samples/pie-customTooltips.html
+++ b/samples/pie-customTooltips.html
@@@ -145,10 -145,10 +145,14 @@@
window.onload = function() {
var ctx1 = document.getElementById("chart-area1").getContext("2d");
-- window.myPie = new Chart(ctx1).Pie(pieData);
++ window.myPie = new Chart(ctx1).Pie({
++ data: pieData
++ });
var ctx2 = document.getElementById("chart-area2").getContext("2d");
-- window.myPie = new Chart(ctx2).Pie(pieData);
++ window.myPie = new Chart(ctx2).Pie({
++ data: pieData
++ });
};
+
+
+
+
diff --cc samples/pie.html
index ca5aecde0,ca5aecde0..0bd0b38a6
--- a/samples/pie.html
+++ b/samples/pie.html
@@@ -52,7 -52,7 +52,9 @@@
window.onload = function(){
var ctx = document.getElementById("chart-area").getContext("2d");
-- window.myPie = new Chart(ctx).Pie(pieData);
++ window.myPie = new Chart(ctx).Pie({
++ data: pieData
++ });
};
$('#randomizeData').click(function(){
diff --cc samples/polar-area.html
index 0828c1020,0828c1020..51682e65b
--- a/samples/polar-area.html
+++ b/samples/polar-area.html
@@@ -53,8 -53,8 +53,11 @@@
window.onload = function(){
var ctx = document.getElementById("chart-area").getContext("2d");
-- window.myPolarArea = new Chart(ctx).PolarArea(polarData, {
-- responsive:true
++ window.myPolarArea = new Chart(ctx).PolarArea({
++ data: polarData,
++ options: {
++ responsive:true
++ }
});
};
diff --cc samples/radar.html
index d26079784,d26079784..0885f61ab
--- a/samples/radar.html
+++ b/samples/radar.html
@@@ -44,8 -44,8 +44,11 @@@
};
window.onload = function(){
-- window.myRadar = new Chart(document.getElementById("canvas").getContext("2d")).Radar(radarChartData, {
-- responsive: true
++ window.myRadar = new Chart(document.getElementById("canvas").getContext("2d")).Radar({
++ data: radarChartData,
++ options: {
++ responsive: true
++ }
});
}
diff --cc samples/scatter-multi-axis.html
index 30473a1ad,000000000..a7ca3f96e
mode 100644,000000..100644
--- a/samples/scatter-multi-axis.html
+++ b/samples/scatter-multi-axis.html
@@@ -1,222 -1,0 +1,225 @@@
+
+
+
+