Graphs getting cut on top without YMax

Bug #1007480 reported by Guzmán Brasó on 2012-06-01
This bug affects 5 people
Affects Status Importance Assigned to Milestone

Bug Description


I've been using graphite for a while, now in a new installation I'm seeing something very strange and I'm unable to find what's going on as no log or obvios problems can be seen.

The problem is that I've two metrics, one have a peak between "None" values of 6.71 and a second metric without None values with two peaks of 6.33 and 6.316. However, the graph shows up to value 6 and peaks get cut. Exactly what one would expect if graph would have yMax=6, however there's no yMax value at all.

Url example:

Raw data same example:

I've attached an image which belongs to the above url and shows this weird behavior.

Any ideas of what could be going on?

I've checked all logs I've found (through find /opt/graphite|grep log$) and no line is appended while loading this graph.

Thank you!


Guzmán Brasó (guzman) wrote :
Michael Leinartas (mleinartas) wrote :

This does look like incorrect behavior. What version of graphite are you on?

Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in ubuntu:
status: New → Confirmed
Bryan Tsai (bryantsai) wrote :

The problem relates to the way of calculating y-axis range. The calculation in many cases would use a yStep causing the final yTop smaller than the actual yMaxValue.

I added the following as a quick work-around so that max value is always shown on the chart. The drawback is sometimes there would be 7 steps (not a big deal compared to be cutting off the top).

< if self.yLabelValues[-1] < yMaxValue:
< self.yLabelValues.append(self.yLabelValues[-1] + self.yStep)

Wesley Ren (wesleyzren) wrote :

Thanks, Bryan. That fixed in the problem for the main (left) axis, but not for the secondary (right) yAxis.
I believe we can do the same for self.yLabelValuesR too. Let me take a look and will post...

John E (jdemod) wrote :

Any update on the secondary yAxis fix?

Wesley Ren (wesleyzren) wrote :

I added following lines for my Graphite version 1.9.0 to work around this problem.
The first one is for one y-axis.
The second and third are for graphs with left and right y-axises.
> if self.yLabelValues[-1] < yMaxValue:
> self.yLabelValues.append(self.yLabelValues[-1] + self.yStep)
> if self.yLabelValuesL[-1] < yMaxValueL:
> self.yLabelValuesL.append(self.yLabelValuesL[-1] + self.yStepL)
> if self.yLabelValuesR[-1] < yMaxValueR:
> self.yLabelValuesR.append(self.yLabelValuesR[-1] + self.yStepR)

Wesley Ren (wesleyzren) wrote :

Basically, you need to find following lines and add their corresponding fixes:
self.yLabelValues = self.getYLabelValues(self.yBottom, self.yTop, self.yStep)

self.yLabelValuesL = self.getYLabelValues(self.yBottomL, self.yTopL, self.yStepL)

self.yLabelValuesR = self.getYLabelValues(self.yBottomR, self.yTopR, self.yStepR)

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers