Graph: New legend option hideEmtpy to hide series with only null values from legend, Closes #1028

This commit is contained in:
Torkel Ödegaard 2014-12-15 16:13:34 +01:00
parent 162eb4ca35
commit 846cf934f5
3 changed files with 10 additions and 0 deletions

View File

@ -1,5 +1,8 @@
# 1.9.1 (unreleased)
**Enhancements**
- [Issue #1028](https://github.com/grafana/grafana/issues/1028). Graph: New legend option ``hideEmtpy`` to hide series with only null values
**Fixes**
- [Issue #1199](https://github.com/grafana/grafana/issues/1199). Graph: fix for series tooltip when one series is hidden/disabled
- [Issue #1207](https://github.com/grafana/grafana/issues/1207). Graphite: movingAverage / movingMedian parameter type impovement, now handles int and interval parameter

View File

@ -44,6 +44,7 @@
<editor-opt-bool text="Values" model="panel.legend.values" change="render()"></editor-opt-bool>
<editor-opt-bool text="Table" model="panel.legend.alignAsTable" change="render()"></editor-opt-bool>
<editor-opt-bool text="Right side" model="panel.legend.rightSide" change="render()"></editor-opt-bool>
<editor-opt-bool text="Hide empty" model="panel.legend.hideEmpty" tip="Hides series with only null values" change="render()"></editor-opt-bool>
</div>
<div class="section" ng-if="panel.legend.values">

View File

@ -125,6 +125,12 @@ function (angular, app, _, kbn, $) {
for (i = 0; i < seriesList.length; i++) {
var series = seriesList[i];
// ignore empty series
if (panel.legend.hideEmpty && series.allIsNull) {
continue;
}
var html = '<div class="graph-legend-series';
if (series.yaxis === 2) { html += ' pull-right'; }
if (scope.hiddenSeries[series.alias]) { html += ' graph-legend-series-hidden'; }