Skip to content

Commit a8f4b02

Browse files
committed
fix(graph): Fixed issue with legend height in table mode with few series, affected iframe embedding as well, fixes grafana#4640
1 parent e8a209c commit a8f4b02

File tree

5 files changed

+30
-38
lines changed

5 files changed

+30
-38
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
* **Graph Panel**: Fixed issue with axis labels overlapping Y-axis, fixes [#4626](https://github.com/grafana/grafana/issues/4626)
1313
* **InfluxDB**: Fixed issue with templating query containing template variable, fixes [#4602](https://github.com/grafana/grafana/issues/4602)
1414
* **Graph Panel**: Fixed issue with hiding series and stacking, fixes [#4557](https://github.com/grafana/grafana/issues/4557)
15-
* **Mixed Datasources**: Fixed issue with mixing many datasources in same graph, fixes [#4604](https://github.com/grafana/grafana/issues/4604)
15+
* **Graph Panel**: Fixed issue with legend height in table mode with few series, affected iframe embedding as well, fixes [#4640](https://github.com/grafana/grafana/issues/4640)
1616

1717
# 3.0.0-beta2 (2016-04-04)
1818

public/app/core/components/switch.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,14 @@ export class SwitchCtrl {
2121
id: any;
2222

2323
/** @ngInject */
24-
constructor($scope) {
24+
constructor($scope, private $timeout) {
2525
this.show = true;
2626
this.id = $scope.$id;
2727
}
2828

2929
internalOnChange() {
3030
return new Promise(resolve => {
31-
setTimeout(() => {
31+
this.$timeout(() => {
3232
this.onChange();
3333
resolve();
3434
});

public/app/features/dashboard/partials/shareModal.html

Lines changed: 24 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -38,31 +38,26 @@ <h2 class="modal-header-title">
3838

3939
<div ng-include src="'shareLinkOptions.html'"></div>
4040

41-
<div class="gf-form-group position-center">
42-
<div class="gf-form width-30" >
41+
<div class="gf-form-group section">
42+
<div class="gf-form width-30">
4343
<textarea rows="5" data-share-panel-url class="gf-form-input width-30" ng-model='iframeHtml'></textarea>
4444
</div>
4545
</div>
46-
<div class="gf-form-group">
47-
<div class="gf-form position-center">
48-
<button class="btn btn-inverse" data-clipboard-text="{{iframeHtml}}" clipboard-button><i class="fa fa-clipboard"></i> Copy</button>
49-
</div>
50-
</div>
5146
</script>
5247

5348
<script type="text/ng-template" id="shareLinkOptions.html">
54-
<div class="gf-form-group position-center">
55-
<div class="gf-form">
56-
<span class="gf-form-label width-5">Include</span>
57-
<editor-checkbox text="Current time range" model="options.forCurrent" change="buildUrl()"></editor-checkbox>
58-
</div>
59-
<div class="gf-form">
60-
<span class="gf-form-label width-5">Include</span>
61-
<editor-checkbox text="Template variables" model="options.includeTemplateVars" change="buildUrl()"></editor-checkbox>
62-
</div>
49+
<div class="gf-form-group section">
50+
<gf-form-switch class="gf-form"
51+
label="Current time range" label-class="width-12" switch-class="max-width-6"
52+
checked="options.forCurrent" on-change="buildUrl()">
53+
</gf-form-switch>
54+
<gf-form-switch class="gf-form"
55+
label="Template variables" label-class="width-12" switch-class="max-width-6"
56+
checked="options.includeTemplateVars" on-change="buildUrl()">
57+
</gf-form-switch>
6358
<div class="gf-form">
64-
<span class="gf-form-label width-5">Theme</span>
65-
<div class="gf-form-select-wrapper max-width-10">
59+
<span class="gf-form-label width-12">Theme</span>
60+
<div class="gf-form-select-wrapper width-6">
6661
<select class="gf-form-input" ng-model="options.theme" ng-options="f as f for f in ['current', 'dark', 'light']" ng-change="buildUrl()"></select>
6762
</div>
6863
</div>
@@ -75,18 +70,19 @@ <h2 class="modal-header-title">
7570
</div>
7671

7772
<div ng-include src="'shareLinkOptions.html'"></div>
78-
<div class="gf-form-group position-center">
79-
<div class="gf-form-inline">
80-
81-
<div class="gf-form width-30">
82-
<input type="text" data-share-panel-url class="gf-form-input" ng-model="shareUrl"></input>
83-
</div>
84-
<div class="gf-form pull-right">
85-
<button class="btn btn-inverse pull-right" data-clipboard-text="{{shareUrl}}" clipboard-button><i class="fa fa-clipboard"></i> Copy</button>
73+
<div>
74+
<div class="gf-form-group section">
75+
<div class="gf-form-inline">
76+
<div class="gf-form width-30">
77+
<input type="text" data-share-panel-url class="gf-form-input" ng-model="shareUrl"></input>
78+
</div>
79+
<div class="gf-form pull-right">
80+
<button class="btn btn-inverse pull-right" data-clipboard-text="{{shareUrl}}" clipboard-button><i class="fa fa-clipboard"></i> Copy</button>
81+
</div>
8682
</div>
8783
</div>
8884
</div>
89-
<div class="gf-form position-center" ng-show="modeSharePanel">
85+
<div class="gf-form section" ng-show="modeSharePanel">
9086
<a href="{{imageUrl}}" target="_blank"><i class="fa fa-camera"></i> Direct link rendered image</a>
9187
</div>
9288
</script>
@@ -117,7 +113,7 @@ <h2 class="modal-header-title">
117113
</p>
118114
</div>
119115

120-
<div class="gf-form-group share-modal-options position-center">
116+
<div class="gf-form-group share-modal-options">
121117
<div class="gf-form" ng-if="step === 1">
122118
<span class="gf-form-label width-12">Snapshot name</span>
123119
<input type="text" ng-model="snapshot.name" class="gf-form-input max-width-15" >

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,9 +194,9 @@ function (angular, _, $) {
194194
}
195195

196196
var topPadding = 6;
197-
$container.css("height", maxHeight - topPadding);
197+
$container.css("max-height", maxHeight - topPadding);
198198
} else {
199-
$container.css("height", "");
199+
$container.css("max-height", "");
200200
}
201201
}
202202
}

public/sass/components/_modals.scss

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@
127127

128128
.share-modal-options {
129129
margin: 11px 20px 33px 20px;
130+
display: inline-block;
130131
}
131132

132133
.share-modal-big-icon {
@@ -162,8 +163,3 @@
162163
}
163164
}
164165

165-
.modal-body {
166-
.position-center {
167-
display: inline-block;
168-
}
169-
}

0 commit comments

Comments
 (0)