Skip to content
Browse files

Fixed jerky animation of data labels after making them true SVGRender…

…er.label items.
  • Loading branch information...
1 parent e7b9247 commit be114e2e9215432aefd8d79fe7c43a3b34608a36 highslide-software committed
Showing with 21 additions and 21 deletions.
  1. +7 −7 js/highcharts.src.js
  2. +7 −7 js/highstock.src.js
  3. +1 −1 js/parts/Chart.js
  4. +6 −6 js/parts/SvgRenderer.js
View
14 js/highcharts.src.js
@@ -4046,15 +4046,15 @@ SVGRenderer.prototype = {
// rename attributes
attrSetters.x = function (value) {
- wrapperX = value;
- wrapperX -= { left: 0, center: 0.5, right: 1 }[align] * ((width || bBox.width) + padding);
-
- wrapper.attr('translateX', mathRound(wrapperX));
+ value -= { left: 0, center: 0.5, right: 1 }[align] * ((width || bBox.width) + padding);
+ wrapperX = wrapper.x = mathRound(value); // wrapper.x is for animation getter
+
+ wrapper.attr('translateX', wrapperX);
return false;
};
attrSetters.y = function (value) {
- wrapperY = value;
- wrapper.attr('translateY', mathRound(value));
+ wrapperY = wrapper.y = mathRound(value);
+ wrapper.attr('translateY', value);
return false;
};
@@ -6915,7 +6915,7 @@ function Chart(userOptions, callback) {
}
// handle automatic or user set offset
- offset = directionFactor * pick(options.offset, axisOffset[side]);
+ offset = directionFactor * pick(options.offset, axisOffset[side]); // docs
axisTitleMargin =
pick(titleOffsetOption,
View
14 js/highstock.src.js
@@ -4046,15 +4046,15 @@ SVGRenderer.prototype = {
// rename attributes
attrSetters.x = function (value) {
- wrapperX = value;
- wrapperX -= { left: 0, center: 0.5, right: 1 }[align] * ((width || bBox.width) + padding);
-
- wrapper.attr('translateX', mathRound(wrapperX));
+ value -= { left: 0, center: 0.5, right: 1 }[align] * ((width || bBox.width) + padding);
+ wrapperX = wrapper.x = mathRound(value); // wrapper.x is for animation getter
+
+ wrapper.attr('translateX', wrapperX);
return false;
};
attrSetters.y = function (value) {
- wrapperY = value;
- wrapper.attr('translateY', mathRound(value));
+ wrapperY = wrapper.y = mathRound(value);
+ wrapper.attr('translateY', value);
return false;
};
@@ -6915,7 +6915,7 @@ function Chart(userOptions, callback) {
}
// handle automatic or user set offset
- offset = directionFactor * pick(options.offset, axisOffset[side]);
+ offset = directionFactor * pick(options.offset, axisOffset[side]); // docs
axisTitleMargin =
pick(titleOffsetOption,
View
2 js/parts/Chart.js
@@ -1775,7 +1775,7 @@ function Chart(userOptions, callback) {
}
// handle automatic or user set offset
- offset = directionFactor * pick(options.offset, axisOffset[side]);
+ offset = directionFactor * pick(options.offset, axisOffset[side]); // docs
axisTitleMargin =
pick(titleOffsetOption,
View
12 js/parts/SvgRenderer.js
@@ -2101,15 +2101,15 @@ SVGRenderer.prototype = {
// rename attributes
attrSetters.x = function (value) {
- wrapperX = value;
- wrapperX -= { left: 0, center: 0.5, right: 1 }[align] * ((width || bBox.width) + padding);
-
- wrapper.attr('translateX', mathRound(wrapperX));
+ value -= { left: 0, center: 0.5, right: 1 }[align] * ((width || bBox.width) + padding);
+ wrapperX = wrapper.x = mathRound(value); // wrapper.x is for animation getter
+
+ wrapper.attr('translateX', wrapperX);
return false;
};
attrSetters.y = function (value) {
- wrapperY = value;
- wrapper.attr('translateY', mathRound(value));
+ wrapperY = wrapper.y = mathRound(value);
+ wrapper.attr('translateY', value);
return false;
};

0 comments on commit be114e2

Please sign in to comment.
Something went wrong with that request. Please try again.