Skip to content

Commit

Permalink
Fix inconsistent aspect ratio
Browse files Browse the repository at this point in the history
  • Loading branch information
jtblin committed May 29, 2017
1 parent f3816b5 commit 6e57071
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 3 deletions.
1 change: 0 additions & 1 deletion src/controllers/controller.doughnut.js
Expand Up @@ -12,7 +12,6 @@ module.exports = function(Chart) {
// Boolean - Whether we animate scaling the Doughnut from the centre
animateScale: false
},
aspectRatio: 1,
hover: {
mode: 'single'
},
Expand Down
1 change: 0 additions & 1 deletion src/controllers/controller.polarArea.js
Expand Up @@ -29,7 +29,6 @@ module.exports = function(Chart) {
},

startAngle: -0.5 * Math.PI,
aspectRatio: 1,
legendCallback: function(chart) {
var text = [];
text.push('<ul class="' + chart.id + '-legend">');
Expand Down
1 change: 0 additions & 1 deletion src/controllers/controller.radar.js
Expand Up @@ -5,7 +5,6 @@ module.exports = function(Chart) {
var helpers = Chart.helpers;

Chart.defaults.radar = {
aspectRatio: 1,
scale: {
type: 'radialLinear'
},
Expand Down
5 changes: 5 additions & 0 deletions test/specs/platform.dom.tests.js
Expand Up @@ -100,6 +100,9 @@ describe('Platform.dom', function() {
});

it('should use default "chart" aspect ratio for render and display sizes', function() {
var ratio = Chart.defaults.doughnut.aspectRatio;
Chart.defaults.doughnut.aspectRatio = 1;

var chart = acquireChart({
type: 'doughnut',
options: {
Expand All @@ -111,6 +114,8 @@ describe('Platform.dom', function() {
}
});

Chart.defaults.doughnut.aspectRatio = ratio;

expect(chart).toBeChartOfSize({
dw: 425, dh: 425,
rw: 425, rh: 425,
Expand Down

0 comments on commit 6e57071

Please sign in to comment.