From 6178d030f6f34e720e61d8889f93532db92b47cd Mon Sep 17 00:00:00 2001 From: Zachary Tong Date: Thu, 18 Apr 2013 12:44:07 -0400 Subject: [PATCH] Fix resizing viewbox for svg --- panels/parallelcoordinates/module.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/panels/parallelcoordinates/module.js b/panels/parallelcoordinates/module.js index 53e7ca98bbc..f39b97cc87d 100644 --- a/panels/parallelcoordinates/module.js +++ b/panels/parallelcoordinates/module.js @@ -189,8 +189,8 @@ angular.module('kibana.parallelcoordinates', []) */ function init_panel() { - scope.m = [80, 160, 200, 160]; - scope.w = $(elem[0]).width() - scope.m[1] - scope.m[3], + scope.m = [80, 100, 80, 100]; + scope.w = $(elem[0]).width() - scope.m[1] - scope.m[3]; scope.h = $(elem[0]).height() - scope.m[0] - scope.m[2]; @@ -291,6 +291,13 @@ angular.module('kibana.parallelcoordinates', []) */ function render_panel() { + + //update the svg if the size has changed + scope.w = $(elem[0]).width() - scope.m[1] - scope.m[3]; + scope.h = $(elem[0]).height() - scope.m[0] - scope.m[2]; + scope.svg.attr("viewbox", "0 0 " + (scope.w + scope.m[1] + scope.m[3]) + " " + (scope.h + scope.m[0] + scope.m[2])); + + scope.x = d3.scale.ordinal().domain(scope.panel.fields).rangePoints([0, scope.w]); scope.y = {};