Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix inconsistent aspect ratio #4079

Merged
merged 1 commit into from Jun 4, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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