me._updateElementGeometry(rectangle, index, reset, options);
- rectangle.pivot();
+ rectangle.pivot(me.chart._animationsDisabled);
},
/**
y: y,
};
- point.pivot();
+ point.pivot(me.chart._animationsDisabled);
},
/**
model.endAngle = model.startAngle + model.circumference;
}
- arc.pivot();
+ arc.pivot(chart._animationsDisabled);
},
calculateTotal: function() {
// Now pivot the point for animation
for (i = 0, ilen = points.length; i < ilen; ++i) {
- points[i].pivot();
+ points[i].pivot(me.chart._animationsDisabled);
}
},
}
});
- arc.pivot();
+ arc.pivot(chart._animationsDisabled);
},
countVisibleElements: function() {
var line = meta.dataset;
var points = meta.data || [];
var config = me._config;
+ var animationsDisabled = me.chart._animationsDisabled;
var i, ilen;
// Compatibility: If the properties are defined with only the old name, use those values
// Model
line._model = me._resolveDatasetElementOptions();
- line.pivot();
+ line.pivot(animationsDisabled);
// Update Points
for (i = 0, ilen = points.length; i < ilen; ++i) {
// Now pivot the point for animation
for (i = 0, ilen = points.length; i < ilen; ++i) {
- points[i].pivot();
+ points[i].pivot(animationsDisabled);
}
},
return config;
}
+function isAnimationDisabled(config) {
+ return !config.animation || !(
+ config.animation.duration ||
+ (config.hover && config.hover.animationDuration) ||
+ config.responsiveAnimationDuration
+ );
+}
+
function updateConfig(chart) {
var newOptions = chart.options;
newOptions);
chart.options = chart.config.options = newOptions;
+ chart._animationsDisabled = isAnimationDisabled(newOptions);
chart.ensureScalesHaveIDs();
chart.buildOrUpdateScales();
var me = this;
var i, ilen;
- for (i = 0, ilen = (me.data.datasets || []).length; i < ilen; ++i) {
- if (me.isDatasetVisible(i)) {
- me.getDatasetMeta(i).controller.transition(easingValue);
+ if (!me._animationsDisabled) {
+ for (i = 0, ilen = (me.data.datasets || []).length; i < ilen; ++i) {
+ if (me.isDatasetVisible(i)) {
+ me.getDatasetMeta(i).controller.transition(easingValue);
+ }
}
}
this.hidden = false;
}
- pivot() {
+ pivot(animationsDisabled) {
var me = this;
+ if (animationsDisabled) {
+ me._view = me._model;
+ return me;
+ }
+
if (!me._view) {
me._view = helpers.extend({}, me._model);
}