# HG changeset patch # User Matt Johnston # Date 1341064846 -28800 # Node ID 16f96019a9e029234877486c57b4325a8317f6ab # Parent 41c3d817878db6c8553c43e4b4f3f326ea6c2195# Parent 55710361804b0b2ff7e9e736ef64183364041399 merge diff -r 41c3d817878d -r 16f96019a9e0 web/log.py --- a/web/log.py Wed Jun 27 23:46:12 2012 +0800 +++ b/web/log.py Sat Jun 30 22:00:46 2012 +0800 @@ -62,11 +62,11 @@ if 'voltage' in sensor: have_volts = True vname = 'scalevolts' - graph_args = ['DEF:rawvolts=%(rrdfile)s:temp:AVERAGE:step=3600' % locals(), - 'CDEF:scalevolts=rawvolts,2,-,0.1,/'] + graph_args + graph_args.append('DEF:%(vname)s=%(rrdfile)s:temp:AVERAGE:step=3600' % locals()) else: vname = 'temp%d' % n - graph_args.append('DEF:%(vname)s=%(rrdfile)s:temp:AVERAGE' % locals()) + graph_args.append('DEF:raw%(vname)s=%(rrdfile)s:temp:AVERAGE' % locals()) + graph_args.append('CDEF:%(vname)s=raw%(vname)s,0.1,*,2,+' % locals()) width = config.LINE_WIDTH legend = config.SENSOR_NAMES.get(sensor, sensor) colour = config.SENSOR_COLOURS.get(legend, colour_from_string(sensor)) @@ -90,8 +90,9 @@ '-h', str(config.GRAPH_HEIGHT), '--slope-mode', '--border', '0', - '--vertical-label', 'Temperature', - '--y-grid', '1:1', + '--vertical-label', 'Voltage', + '--y-grid', '0.1:1', + '--dynamic-labels', '--grid-dash', '1:0', '--color', 'GRID#00000000', '--color', 'MGRID#aaaaaa', @@ -103,9 +104,9 @@ args += ['--font', 'DEFAULT:12:%s' % config.GRAPH_FONT] args += ['--font', 'WATERMARK:10:%s' % config.GRAPH_FONT] if have_volts: - args += ['--right-axis', '0.1:2', # matches the scalevolts CDEF above + args += ['--right-axis', '10:-20', # matches the scalevolts CDEF above '--right-axis-format', '%.2lf', - '--right-axis-label', 'Voltage'] + '--right-axis-label', 'Temperature'] rrdtool.graph(*args) return tempf.read()