From: Simon Brunel Date: Fri, 23 Sep 2016 15:44:06 +0000 (+0200) Subject: Fix radar default aspect ratio and samples X-Git-Tag: v2.4.0~1^2~45^2~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d610987cfbc2ed37d5b2d508b1378f9cb401edd2;p=thirdparty%2FChart.js.git Fix radar default aspect ratio and samples Now that the aspect ratio is correctly handled, fix samples for charts with aspect ratio of 1 which was vertically too large. Also fix the default aspect ratio for radar charts which wasn't applied when creating a chart directly using new Chart(ctx, { type: 'radar' }). --- diff --git a/samples/doughnut.html b/samples/doughnut.html index 73c96ad80..38a9d5782 100644 --- a/samples/doughnut.html +++ b/samples/doughnut.html @@ -15,7 +15,7 @@ -
+
diff --git a/samples/polar-area.html b/samples/polar-area.html index ae21e1d44..16572dd45 100644 --- a/samples/polar-area.html +++ b/samples/polar-area.html @@ -15,7 +15,7 @@ -
+
diff --git a/samples/radar-skip-points.html b/samples/radar-skip-points.html index 9d0816d4b..c1680afd0 100644 --- a/samples/radar-skip-points.html +++ b/samples/radar-skip-points.html @@ -15,7 +15,7 @@ -
+
diff --git a/samples/radar.html b/samples/radar.html index 4203cff15..eadcd9eca 100644 --- a/samples/radar.html +++ b/samples/radar.html @@ -15,7 +15,7 @@ -
+
diff --git a/src/charts/Chart.Radar.js b/src/charts/Chart.Radar.js index 1648e9fac..d17bd5d81 100644 --- a/src/charts/Chart.Radar.js +++ b/src/charts/Chart.Radar.js @@ -3,7 +3,6 @@ module.exports = function(Chart) { Chart.Radar = function(context, config) { - config.options = Chart.helpers.configMerge({aspectRatio: 1}, config.options); config.type = 'radar'; return new Chart(context, config); diff --git a/src/controllers/controller.radar.js b/src/controllers/controller.radar.js index 3c050595a..6232165f3 100644 --- a/src/controllers/controller.radar.js +++ b/src/controllers/controller.radar.js @@ -5,6 +5,7 @@ module.exports = function(Chart) { var helpers = Chart.helpers; Chart.defaults.radar = { + aspectRatio: 1, scale: { type: 'radialLinear' },