mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 17:59:23 -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
|
// check widths to apply rotate
|
||||||
var bbox = selection.selectAll('.tick text').node().getBBox();
|
var bbox = selection.selectAll('.tick text').node().getBBox();
|
||||||
var tickN = selection.selectAll('.tick text')[0].length;
|
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];
|
var lbls = selection.selectAll('.tick text')[0];
|
||||||
console.log('ticks n', tickN, lbls);
|
var maxW = width / tickN;
|
||||||
for (var i = 0; i < tickN; i++) {
|
for (var i = 0; i < tickN; i++) {
|
||||||
console.log(i, lbls[i]);
|
if (lbls[i].clientWidth > maxW) {
|
||||||
//if (bbox[i]) {
|
self.rotateAxisLabels(selection);
|
||||||
//}
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// check widths to apply filter
|
// check widths to apply filter
|
||||||
|
|
|
@ -25,7 +25,6 @@ define(function (require) {
|
||||||
};
|
};
|
||||||
|
|
||||||
YAxis.prototype.appendSVG = function (self) {
|
YAxis.prototype.appendSVG = function (self) {
|
||||||
console.log(self);
|
|
||||||
return function (selection) {
|
return function (selection) {
|
||||||
selection.each(function () {
|
selection.each(function () {
|
||||||
var div = d3.select(this);
|
var div = d3.select(this);
|
||||||
|
|
|
@ -103,8 +103,6 @@ define(function (require) {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
console.log(this);
|
|
||||||
|
|
||||||
this.checkSize('.chart');
|
this.checkSize('.chart');
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue