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
20 def get_canvas_pos(self, size, val, min, max2):
21 return size * (val - min) / max(float(max2 - min),0.01)
23 def get_tics(self, min, max, interval):
30 def get_min_max(self, dmin, dmax, interval):
35 interval = 10 ** (float(int(math.log(dmax-dmin)/math.log(10))))
36 dmin = min(dmin, pychart_util.round_down(dmin, interval))
37 dmax = max(dmax, pychart_util.round_up(dmax, interval) + interval/2.0)
38 return dmin, dmax, interval