mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Fix resizing viewbox for svg
This commit is contained in:
parent
91eaef48b3
commit
6178d030f6
@ -189,8 +189,8 @@ angular.module('kibana.parallelcoordinates', [])
|
|||||||
*/
|
*/
|
||||||
function init_panel() {
|
function init_panel() {
|
||||||
|
|
||||||
scope.m = [80, 160, 200, 160];
|
scope.m = [80, 100, 80, 100];
|
||||||
scope.w = $(elem[0]).width() - scope.m[1] - scope.m[3],
|
scope.w = $(elem[0]).width() - scope.m[1] - scope.m[3];
|
||||||
scope.h = $(elem[0]).height() - scope.m[0] - scope.m[2];
|
scope.h = $(elem[0]).height() - scope.m[0] - scope.m[2];
|
||||||
|
|
||||||
|
|
||||||
@ -291,6 +291,13 @@ angular.module('kibana.parallelcoordinates', [])
|
|||||||
*/
|
*/
|
||||||
function render_panel() {
|
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.x = d3.scale.ordinal().domain(scope.panel.fields).rangePoints([0, scope.w]);
|
||||||
scope.y = {};
|
scope.y = {};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user