Ticket #15 (closed defect: fixed)

Opened 3 years ago

Last modified 3 years ago

chart.py : integer division in the xscale computation formula

Reported by: laurent Owned by: somebody
Priority: major Milestone:
Component: component1 Version:
Keywords: range Cc:

Description

Hi,

I just discovered your PyCha? a few days ago, and I love it. Pythonic, simple, cute and complete at the same time, thank you :)

I found a little "oversight" when I was trying to set a custom range for my axis : the xscale computation formula (chart.py) does not force the float mode.

For example, when i give a range with integers (0,1000), xrange = 1000 - 0 = 1000, and then xscale = 1 / 1000 = 0 (integer division) !!! I know I could set ranges like that (0.0,1000.0), but imho the best method to ensure a good result would be to replace these lines :

166 self.xscale = 1 / self.xrange 182 self.yscale = 1 / self.yrange

By these ones :

166 self.xscale = 1.0 / self.xrange 182 self.yscale = 1.0 / self.yrange

That could perhaps spare troubles to many people ;)

Laurent

Change History

Changed 3 years ago by lgs

  • status changed from new to closed
  • resolution set to fixed

Fixed at [141] and [142]

Note: See TracTickets for help on using tickets.