1 # -*- coding: utf-8 -*-
3 # Copyright (C) 2000-2005 by Yasushi Saito (yasushi.saito@gmail.com)
5 # Jockey is free software; you can redistribute it and/or modify it
6 # under the terms of the GNU General Public License as published by the
7 # Free Software Foundation; either version 2, or (at your option) any
10 # Jockey is distributed in the hope that it will be useful, but WITHOUT
11 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19 def __init__(self, data, col):
21 """This attribute is meaningful only when x_coord_system ==
22 'category'. This attribute selects the column of
23 'x_category_data' from which X values are computed.
24 Meaningful only when x_coord_system == 'category'. This
25 attribute specifies the data-set from which the X values are
26 extracted. See also x_category_col."""
31 def get_canvas_pos(self, size, val, min, max):
34 if v[self.col] == val:
35 return size * i / float(len(self.data))
37 # the drawing area is clipped. So negative offset will make this plot
39 return canvas.invalid_coord;
40 def get_tics(self, min, max, interval):
42 if interval == None: interval = 1
44 for i in range(0, len(self.data), interval):
45 tics.append(self.data[i][self.col])
47 #return map(lambda pair, self = self: pair[self.col], self.data)