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