mirror of
https://github.com/chartjs/Chart.js.git
synced 2025-12-08 20:36:08 +00:00
Fix inconsistent aspect ratio
This commit is contained in:
parent
f7f177f5ad
commit
fa6be2f772
@ -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'
|
||||
},
|
||||
|
||||
@ -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">');
|
||||
|
||||
@ -5,7 +5,6 @@ module.exports = function(Chart) {
|
||||
var helpers = Chart.helpers;
|
||||
|
||||
Chart.defaults.radar = {
|
||||
aspectRatio: 1,
|
||||
scale: {
|
||||
type: 'radialLinear'
|
||||
},
|
||||
|
||||
@ -122,6 +122,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: {
|
||||
@ -133,6 +136,8 @@ describe('Platform.dom', function() {
|
||||
}
|
||||
});
|
||||
|
||||
Chart.defaults.doughnut.aspectRatio = ratio;
|
||||
|
||||
expect(chart).toBeChartOfSize({
|
||||
dw: 425, dh: 425,
|
||||
rw: 425, rh: 425,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user