from GChartWrapper import * # multiple axis with label positions specified # values between 0 and 100 - use text encoding data = [[4.6, 6.0, 7.4, 11.6, 12.0, 14.8, 18.1, 25.1, 27.9, 28.3, 30.6, 34.4, 43.7, 48.3, 57.6, 64.6, 72.5, 74.4, 76.2, 77.2, 86.0, 86.9, 93.9, 96.7, 99.0], [80.5, 100.0, 95.4, 93.7, 96.3, 91.7, 71.5, 63.0, 65.2, 65.5, 66.0, 75.9, 65.8, 64.4, 64.2, 62.5, 37.2, 35.3, 32.4, 35.2, 38.4, 37.9, 69.8, 38.0, 64.5]] # positions between 0 and 100 axis = [ [0, 13, 28, 42, 56, 71, 84, 100], ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H'] ] # don't do integer arithmetic min_value = float(min(data[1])) max_value = float(max(data[1])) last_value = float(data[1][-1]) G = LineXY(data, encoding='text') G.color('76A4FB') G.marker('o', '0077CC',0,-1,5) G.marker('r', 'E6F2FA',0,(min_value/max_value),1.0) # 0 to 1.0 G.axes("xyr") G.axes.label(0, *axis[1]) G.axes.position(0, *axis[0]) G.axes.label(1, '%d'%min_value, '%d'%max_value) G.axes.position(1, int(100*min_value/max_value),100) # 0 to 100 G.axes.label(2, '%d'%last_value) G.axes.position(2, int(100*last_value/max_value)) # 0 to 100