Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

When using functions like removeBelowValue, data series might be empty. ... #150

Open
wants to merge 1 commit into from

2 participants

bryantsai Jason Dixon
bryantsai

When using functions like removeBelowValue, data series might be empty. Legends of such empty series are still shown, which is not so perfect especially when the number of legends are not small. Added check for such condition so such legends are ignored automatically.

bryantsai bryantsai When using functions like removeBelowValue, data series might be empt…
…y. Legends of such empty series are still shown, which is not so perfect especially when the number of legends are not small. Added check for such condition so such legends are ignored automatically.
ff6e360
Jason Dixon
Owner

I like the intent, but I think that not showing legend elements because all values are Null is confusing. What happens when someone requests 2 metrics and one of them doesn't render because there are no datapoints? I think this has the potential to be very confusing.

cc @mleinart for his input.

Jason Dixon
Owner

After discussing with @mleinart I think that the right approach is not to automatically start hiding null series (which would introduce unexpected behavior), but to add a function (e.g. "hideNullFromLegend") that would allow for hiding these sorts of series from the legend.

@bryantsai Would you mind tweaking this as a function like I describe?

Note: I'm not saying that @mleinart agrees with me, only that I discussed this with him.

This was referenced
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Feb 10, 2013
  1. bryantsai

    When using functions like removeBelowValue, data series might be empt…

    bryantsai authored
    …y. Legends of such empty series are still shown, which is not so perfect especially when the number of legends are not small. Added check for such condition so such legends are ignored automatically.
This page is out of date. Refresh to see the latest.
Showing with 1 addition and 1 deletion.
  1. +1 −1  webapp/graphite/render/glyph.py
2  webapp/graphite/render/glyph.py
View
@@ -638,7 +638,7 @@ def drawGraph(self,**params):
self.setFont()
if not params.get('hideLegend', len(self.data) > settings.LEGEND_MAX_ITEMS):
- elements = [ (series.name,series.color,series.options.get('secondYAxis')) for series in self.data if series.name ]
+ elements = [ (series.name,series.color,series.options.get('secondYAxis')) for series in self.data if series.name and not all(v is None for v in series) ]
self.drawLegend(elements, params.get('uniqueLegend', False))
#Setup axes, labels, and grid
Something went wrong with that request. Please try again.