def draw(self):
l, t, r, b = 35,35,15,35
w = self.width - l - r
h = self.height - t - b
if self.data is None:return
dc = wx.BufferedDC(wx.ClientDC(self), self.buffer)
dc.Clear()
left, low, right, high = self.extent
self.draw_coord(dc, w, h, l, t, r, b)
for xs, ys, c, lw in self.data:
ys = h+t - (ys - low)*(h/(high-low))
xs = l+(xs-left)*(1.0/(right-left)*w)
pts = list(zip(xs, ys))
dc.SetPen(wx.Pen(c, width=lw, style=wx.SOLID))
dc.DrawLines(pts)
评论列表
文章目录