From 93cf5d564b2c4803da738dd89e741a9b07d15392 Mon Sep 17 00:00:00 2001 From: Shelby Sturgis Date: Fri, 5 Jun 2015 12:07:39 -0400 Subject: [PATCH] fixing issue with shrinking titles --- src/kibana/components/vislib/lib/chart_title.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/kibana/components/vislib/lib/chart_title.js b/src/kibana/components/vislib/lib/chart_title.js index 8ab0eaf89da4..7ca482a160e2 100644 --- a/src/kibana/components/vislib/lib/chart_title.js +++ b/src/kibana/components/vislib/lib/chart_title.js @@ -108,11 +108,16 @@ define(function (require) { div.append('svg') .attr('width', function () { if (dataType === 'rows') { - return 15; + return height; } return width; }) - .attr('height', height) + .attr('height', function () { + if (dataType === 'rows') { + return width; + } + return height; + }) .append('text') .attr('transform', function () { if (dataType === 'rows') { @@ -121,9 +126,7 @@ define(function (require) { return 'translate(' + width / 2 + ',' + txtHtOffset + ')'; }) .attr('text-anchor', 'middle') - .text(function (d) { - return d.label; - }); + .text(function (d) { return d.label; }); // truncate long chart titles div.selectAll('text')