1 --- glyph.py.orig 2011-11-24 01:51:01.000000000 +0000
2 +++ glyph.py 2011-11-24 01:53:12.000000000 +0000
4 'minorGridLineColor','thickness','min','max', \
5 'graphOnly','yMin','yMax','yLimit','yStep','areaMode', \
6 'areaAlpha','drawNullAsZero','tz', 'yAxisSide','pieMode', \
8 + 'yUnitSystem', 'yAxisType')
9 validLineModes = ('staircase','slope')
10 validAreaModes = ('none','first','all','stacked')
11 validPieModes = ('maximum', 'minimum', 'average')
13 params['hideGrid'] = True
14 params['hideAxes'] = True
15 params['yAxisSide'] = 'left'
16 + params['yAxisType'] = 'linear'
21 params['yAxisSide'] = 'left'
22 if 'yUnitSystem' not in params:
23 params['yUnitSystem'] = 'si'
24 + if 'yAxisType' not in params:
25 + params['yAxisType'] = 'linear'
27 # When Y Axis is labeled on the right, we subtract x-axis positions from the max,
28 # instead of adding to the minimum
30 ySpan, spanPrefix = format_units(self.ySpan, self.yStep,
31 system=self.params.get('yUnitSystem'))
33 - if ySpan > 10 or spanPrefix != prefix:
34 - return "%d %s " % (int(yValue), prefix)
35 + if self.params.get('yAxisType') == 'linear':
36 + if ySpan > 10 or spanPrefix != prefix:
37 + return "%d %s " % (int(yValue), prefix)
40 - return "%.1f %s " % (float(yValue), prefix)
42 + return "%.1f %s " % (float(yValue), prefix)
45 - return "%.2f %s " % (float(yValue), prefix)
47 + return "%.2f %s " % (float(yValue), prefix)
50 - return "%g %s" % (float(yValue), prefix)
52 + return "%g %s" % (float(yValue), prefix)
53 + elif self.params.get('yAxisType') == 'log':
54 + if ySpan > 10 or spanPrefix != prefix:
55 + return "%d %s " % (math.pow(10,int(yValue)), prefix)
58 + return "%.1f %s " % (math.pow(10,float(yValue)), prefix)
61 + return "%.2f %s " % (math.pow(10,float(yValue)), prefix)
64 + return "%g %s " % (math.pow(10,float(yValue)), prefix)
66 self.yLabelValues = list( frange(self.yBottom,self.yTop,self.yStep) )
67 self.yLabels = map(makeLabel,self.yLabelValues)