From d610987cfbc2ed37d5b2d508b1378f9cb401edd2 Mon Sep 17 00:00:00 2001 From: Simon Brunel Date: Fri, 23 Sep 2016 17:44:06 +0200 Subject: [PATCH] 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' }). --- samples/doughnut.html | 2 +- samples/polar-area.html | 2 +- samples/radar-skip-points.html | 2 +- samples/radar.html | 2 +- src/charts/Chart.Radar.js | 1 - src/controllers/controller.radar.js | 1 + 6 files changed, 5 insertions(+), 5 deletions(-) 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' },