From f15cd2a9e78ba5046fc255307e9a41aced11a6a7 Mon Sep 17 00:00:00 2001 From: Juan Thomassie Date: Fri, 26 Sep 2014 09:20:25 -0500 Subject: [PATCH] added padding var to XAxis.filterAxisLabels to adjust space between labels before filtering --- src/kibana/components/vislib/lib/x_axis.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/kibana/components/vislib/lib/x_axis.js b/src/kibana/components/vislib/lib/x_axis.js index 34be1499fc8a7..9fa690a586842 100644 --- a/src/kibana/components/vislib/lib/x_axis.js +++ b/src/kibana/components/vislib/lib/x_axis.js @@ -256,14 +256,15 @@ define(function (require) { var myX; var myWidth; var halfWidth; + var padding = 1.1; return function (selection) { selection.selectAll('.tick text') .text(function (d, i) { par = d3.select(this.parentNode).node(); myX = self.xScale(d); - myWidth = par.getBBox().width; - halfWidth = par.getBBox().width / 2; + myWidth = par.getBBox().width * padding; + halfWidth = myWidth / 2; maxW = $(self.el).find('.x-axis-div').width(); if ((startX + halfWidth) < myX && maxW > (myX + halfWidth)) {