(self)
| 110 | dc.DrawText(self.labely, 5, 10) |
| 111 | |
| 112 | def draw(self): |
| 113 | l, t, r, b = 35,35,15,35 |
| 114 | w = self.width - l - r |
| 115 | h = self.height - t - b |
| 116 | if self.data is None:return |
| 117 | dc = wx.BufferedDC(wx.ClientDC(self), self.buffer) |
| 118 | dc.Clear() |
| 119 | |
| 120 | left, low, right, high = self.extent |
| 121 | self.draw_coord(dc, w, h, l, t, r, b) |
| 122 | for xs, ys, c, lw in self.data: |
| 123 | ys = h+t - (ys - low)*(h/(high-low)) |
| 124 | xs = l+(xs-left)*(1.0/(right-left)*w) |
| 125 | pts = list(zip(xs, ys)) |
| 126 | dc.SetPen(wx.Pen(c, width=lw, style=wx.SOLID)) |
| 127 | dc.DrawLines(pts) |
| 128 | |
| 129 | def save(self, path): |
| 130 | self.buffer.SaveFile(path, wx.BITMAP_TYPE_PNG) |
no test coverage detected