Open panthony opened 5 years ago
When loading new data, the xAxis label is badly positioned when using rotate option.
See http://jsfiddle.net/m9c8qpd2/
The issue is here:
AxisInternal.prototype.updateTickTextCharSize = function (tick) { var internal = this; if (internal.tickTextCharSize) { return internal.tickTextCharSize; } var size = { h: 11.5, w: 5.5 }; tick.select('text').text(function(d) { return internal.textFormatted(d); }).each(function (d) { var box = this.getBoundingClientRect(), text = internal.textFormatted(d), h = box.height, w = text ? (box.width / text.length) : undefined; if (h && w) { size.h = h; size.w = w; } }).text(''); internal.tickTextCharSize = size; return size; };
We are recomputing the "text char size" using the box's height whereas this is false when the box is rotated.
When loading new data, the xAxis label is badly positioned when using rotate option.
See http://jsfiddle.net/m9c8qpd2/
The issue is here:
We are recomputing the "text char size" using the box's height whereas this is false when the box is rotated.