mirror of
https://github.com/getredash/redash.git
synced 2025-12-19 17:37:19 -05:00
Let plotly calculate the height based on provided margin values
This commit is contained in:
@@ -121,7 +121,6 @@
|
||||
angular.module('plotly', [])
|
||||
.constant('ColorPalette', ColorPalette)
|
||||
.directive('plotlyChart', function () {
|
||||
var baseHeight = 250;
|
||||
var bottomMargin = 50;
|
||||
return {
|
||||
restrict: 'E',
|
||||
@@ -165,7 +164,6 @@
|
||||
scope.layout.showlegend = _.has(scope.options, 'legend') ? scope.options.legend.enabled : true;
|
||||
if(_.has(scope.options, 'bottomMargin')) {
|
||||
bottomMargin = parseInt(scope.options.bottomMargin);
|
||||
scope.layout.height = baseHeight + bottomMargin;
|
||||
scope.layout.margin.b = bottomMargin;
|
||||
}
|
||||
delete scope.layout.barmode;
|
||||
@@ -289,7 +287,7 @@
|
||||
scope.$watch('options', recalculateOptions, true);
|
||||
|
||||
|
||||
scope.layout = {margin: {l: 50, r: 50, b: bottomMargin, t: 20, pad: 4}, height: baseHeight+bottomMargin, autosize: true, hovermode: 'closest'};
|
||||
scope.layout = {margin: {l: 50, r: 50, b: bottomMargin, t: 20, pad: 4}, autosize: true, hovermode: 'closest'};
|
||||
scope.plotlyOptions = {showLink: false, displaylogo: false};
|
||||
scope.data = [];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user