mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Graph Panel: Legend in table mode now aligns, graph area is reduced depending on how many series, Fixes #1786, Fixes #1749
This commit is contained in:
parent
fc47fb8f64
commit
d71b626114
@ -1,6 +1,8 @@
|
|||||||
# 2.0.0 (unreleased)
|
# 2.0.0 (unreleased)
|
||||||
|
|
||||||
**Fixes**
|
**Fixes**
|
||||||
|
- [Issue #1749](https://github.com/grafana/grafana/issues/1749). Graph Panel: Table legends are now visible when rendered to PNG
|
||||||
|
- [Issue #1786](https://github.com/grafana/grafana/issues/1786). Graph Panel: Legend in table mode now aligns, graph area is reduced depending on how many series
|
||||||
- [Issue #1734](https://github.com/grafana/grafana/issues/1734). Support for unicode / international characters in dashboard title (improved slugify)
|
- [Issue #1734](https://github.com/grafana/grafana/issues/1734). Support for unicode / international characters in dashboard title (improved slugify)
|
||||||
- [Issue #1782](https://github.com/grafana/grafana/issues/1782). Github OAuth: Now works with Github for Enterprise, thanks @williamjoy
|
- [Issue #1782](https://github.com/grafana/grafana/issues/1782). Github OAuth: Now works with Github for Enterprise, thanks @williamjoy
|
||||||
- [Issue #1780](https://github.com/grafana/grafana/issues/1780). Dashboard snapshot: Should not require login to view snapshot, Fixes #1780
|
- [Issue #1780](https://github.com/grafana/grafana/issues/1780). Dashboard snapshot: Should not require login to view snapshot, Fixes #1780
|
||||||
|
@ -63,6 +63,17 @@ function (angular, $, kbn, moment, _, GraphTooltip) {
|
|||||||
render_panel();
|
render_panel();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
function getLegendHeight() {
|
||||||
|
if (!scope.panel.legend.show || scope.panel.legend.rightSide) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
if (scope.panel.legend.alignAsTable) {
|
||||||
|
return 30 + (25 * data.length);
|
||||||
|
} else {
|
||||||
|
return 26;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function setElementHeight() {
|
function setElementHeight() {
|
||||||
try {
|
try {
|
||||||
graphHeight = scope.height || scope.panel.height || scope.row.height;
|
graphHeight = scope.height || scope.panel.height || scope.row.height;
|
||||||
@ -73,9 +84,7 @@ function (angular, $, kbn, moment, _, GraphTooltip) {
|
|||||||
graphHeight -= 5; // padding
|
graphHeight -= 5; // padding
|
||||||
graphHeight -= scope.panel.title ? 24 : 9; // subtract panel title bar
|
graphHeight -= scope.panel.title ? 24 : 9; // subtract panel title bar
|
||||||
|
|
||||||
if (scope.panel.legend.show && !scope.panel.legend.rightSide) {
|
graphHeight = graphHeight - getLegendHeight(); // subtract one line legend
|
||||||
graphHeight = graphHeight - 26; // subtract one line legend
|
|
||||||
}
|
|
||||||
|
|
||||||
elem.css('height', graphHeight + 'px');
|
elem.css('height', graphHeight + 'px');
|
||||||
|
|
||||||
|
@ -79,7 +79,6 @@
|
|||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
padding: 2px 10px;
|
padding: 2px 10px;
|
||||||
text-align: right;
|
text-align: right;
|
||||||
border-bottom: 1px solid @grafanaListBorderBottom;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.graph-legend-icon {
|
.graph-legend-icon {
|
||||||
|
Loading…
Reference in New Issue
Block a user