| 22 | | class ScatterplotChart(Chart): |
| 23 | | |
| 24 | | def __init__(self, surface=None, options={}): |
| 25 | | super(ScatterplotChart, self).__init__(surface, options) |
| 26 | | self.points = [] |
| 27 | | |
| 28 | | def _updateChart(self): |
| 29 | | """Evaluates measures for scatterplots""" |
| 30 | | self.points = [] |
| 31 | | |
| 32 | | for i, (name, store) in enumerate(self.datasets): |
| 33 | | for item in store: |
| 34 | | xval, yval = item |
| 35 | | x = (xval - self.minxval) * self.xscale |
| 36 | | y = 1.0 - (yval - self.minyval) * self.yscale |
| 37 | | point = Point(x, clamp(0.0, 1.0, y), xval, yval, name) |
| 38 | | |
| 39 | | if 0.0 <= point.x <= 1.0: |
| 40 | | self.points.append(point) |
| 41 | | |
| | 22 | class ScatterplotChart(LineChart): |
| | 23 | |