Skip to content

Commit c0cf0cb

Browse files
Qtaxbergquist
authored andcommitted
Added an option to set a min-width for the graphs side table/area.
1 parent 311624b commit c0cf0cb

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

public/app/plugins/panels/graph/axisEditor.html

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,13 @@
181181
<li class="tight-form-item">
182182
<editor-checkbox text="Right side" model="panel.legend.rightSide" change="render()"></editor-checkbox>
183183
</li>
184+
<li ng-if="panel.legend.rightSide" class="tight-form-item">
185+
Side width
186+
</li>
187+
<li ng-if="panel.legend.rightSide" style="width: 105px">
188+
<input type="number" class="input-small tight-form-input" placeholder="250" bs-tooltip="'Set a min-width for the legend side table/block'" data-placement="right"
189+
ng-model="panel.legend.sideWidth" ng-change="render()" ng-model-onblur>
190+
</li>
184191
</ul>
185192
<div class="clearfix"></div>
186193
</div>

public/app/plugins/panels/graph/legend.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,10 @@ function (angular, _, $) {
101101

102102
$container.empty();
103103

104+
// Set min-width if side style and there is a value, otherwise remove the CSS propery
105+
var width = panel.legend.rightSide && panel.legend.sideWidth ? panel.legend.sideWidth + "px" : "";
106+
$container.css("min-width", width);
107+
104108
$container.toggleClass('graph-legend-table', panel.legend.alignAsTable === true);
105109

106110
if (panel.legend.alignAsTable) {

0 commit comments

Comments
 (0)