mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
fixed how x_axis checks widths to apply rotate
This commit is contained in:
parent
6d30475744
commit
264e29b75f
3 changed files with 5 additions and 12 deletions
|
@ -31,17 +31,13 @@ define(function (require) {
|
|||
// check widths to apply rotate
|
||||
var bbox = selection.selectAll('.tick text').node().getBBox();
|
||||
var tickN = selection.selectAll('.tick text')[0].length;
|
||||
var ticksLength = bbox.width * 1.05 * tickN;
|
||||
if (ticksLength > width) {
|
||||
self.rotateAxisLabels(selection);
|
||||
}
|
||||
|
||||
var lbls = selection.selectAll('.tick text')[0];
|
||||
console.log('ticks n', tickN, lbls);
|
||||
var maxW = width / tickN;
|
||||
for (var i = 0; i < tickN; i++) {
|
||||
console.log(i, lbls[i]);
|
||||
//if (bbox[i]) {
|
||||
//}
|
||||
if (lbls[i].clientWidth > maxW) {
|
||||
self.rotateAxisLabels(selection);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// check widths to apply filter
|
||||
|
|
|
@ -25,7 +25,6 @@ define(function (require) {
|
|||
};
|
||||
|
||||
YAxis.prototype.appendSVG = function (self) {
|
||||
console.log(self);
|
||||
return function (selection) {
|
||||
selection.each(function () {
|
||||
var div = d3.select(this);
|
||||
|
|
|
@ -103,8 +103,6 @@ define(function (require) {
|
|||
}
|
||||
});
|
||||
|
||||
console.log(this);
|
||||
|
||||
this.checkSize('.chart');
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue