~lucio.torre/graphite/add-mongo

« back to all changes in this revision

Viewing changes to webapp/graphite/render/glyph.py

  • Committer: Charles A Beasley
  • Date: 2011-04-11 20:17:08 UTC
  • Revision ID: carmelchas@gmail.com-20110411201708-bx1l9v1oh65gmbcw
logarithmic scale implementation

Show diffs side-by-side

added added

removed removed

Lines of Context:
432
432
 
433
433
    if self.logScale:
434
434
        if value <= 0: return None
435
 
        relativeValue = math.log(relativeValue, self.logBase)
 
435
        if relativeValue > 0: relativeValue = math.log(relativeValue, self.logBase)
436
436
        valueRange = math.log(highestValue, self.logBase) - math.log(lowestValue, self.logBase)
437
437
 
438
438
    pixelToValueRatio = pixelRange / valueRange