mirror of
https://github.com/chartjs/Chart.js.git
synced 2025-12-08 20:36:08 +00:00
Better responsive sizing
This commit is contained in:
parent
088b4fcc55
commit
63530ba66d
8
Chart.js
vendored
8
Chart.js
vendored
@ -71,6 +71,7 @@
|
||||
Chart.defaults = {
|
||||
global: {
|
||||
responsive: true,
|
||||
responsiveAnimationDuration: 0,
|
||||
maintainAspectRatio: true,
|
||||
events: ["mousemove", "mouseout", "click", "touchstart", "touchmove", "touchend"],
|
||||
hover: {
|
||||
@ -83,6 +84,7 @@
|
||||
|
||||
// Element defaults defined in element extensions
|
||||
elements: {}
|
||||
|
||||
},
|
||||
};
|
||||
|
||||
@ -1092,7 +1094,7 @@
|
||||
dropFrames: 0,
|
||||
addAnimation: function(chartInstance, animationObject, duration) {
|
||||
|
||||
if (!duration) {
|
||||
if (typeof duration !== 'number' || duration === 0) {
|
||||
chartInstance.animating = true;
|
||||
}
|
||||
|
||||
@ -1633,10 +1635,10 @@
|
||||
// Cascade the resize event down to the chart.
|
||||
if (instance.options.responsive) {
|
||||
instance.resize();
|
||||
instance.update();
|
||||
instance.update(Chart.defaults.global.responsiveAnimationDuration);
|
||||
}
|
||||
});
|
||||
}, 50);
|
||||
}, 16);
|
||||
};
|
||||
})());
|
||||
|
||||
|
||||
4
Chart.min.js
vendored
4
Chart.min.js
vendored
File diff suppressed because one or more lines are too long
@ -29,7 +29,7 @@
|
||||
dropFrames: 0,
|
||||
addAnimation: function(chartInstance, animationObject, duration) {
|
||||
|
||||
if (!duration) {
|
||||
if (typeof duration !== 'number' || duration === 0) {
|
||||
chartInstance.animating = true;
|
||||
}
|
||||
|
||||
|
||||
@ -71,6 +71,7 @@
|
||||
Chart.defaults = {
|
||||
global: {
|
||||
responsive: true,
|
||||
responsiveAnimationDuration: 0,
|
||||
maintainAspectRatio: true,
|
||||
events: ["mousemove", "mouseout", "click", "touchstart", "touchmove", "touchend"],
|
||||
hover: {
|
||||
@ -83,6 +84,7 @@
|
||||
|
||||
// Element defaults defined in element extensions
|
||||
elements: {}
|
||||
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
@ -20,10 +20,10 @@
|
||||
// Cascade the resize event down to the chart.
|
||||
if (instance.options.responsive) {
|
||||
instance.resize();
|
||||
instance.update();
|
||||
instance.update(Chart.defaults.global.responsiveAnimationDuration);
|
||||
}
|
||||
});
|
||||
}, 50);
|
||||
}, 16);
|
||||
};
|
||||
})());
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user