Changeset 109 for trunk/src/scatter.py
- Timestamp:
- 10/27/08 16:49:58 (4 years ago)
- Files:
-
- 1 modified
-
trunk/src/scatter.py (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/scatter.py
r96 r109 16 16 # along with PyCha. If not, see <http://www.gnu.org/licenses/>. 17 17 18 from pycha.chart import Chart 19 from pycha.color import hex2rgb, clamp 20 from pycha.line import Point, LineChart 18 from pycha.line import LineChart 21 19 22 20 class ScatterplotChart(LineChart): … … 24 22 def _renderChart(self, cx): 25 23 """Renders a scatterplot""" 26 def drawSymbol(point, size=2):27 ox = point.x * self.area.w + self.area.x28 oy = point.y * self.area.h + self.area.y29 cx.move_to(ox-size, oy )30 cx.line_to(ox+size, oy )31 cx.move_to(ox , oy-size)32 cx.line_to(ox , oy+size)24 def drawSymbol(point, size=2): 25 ox = point.x * self.area.w + self.area.x 26 oy = point.y * self.area.h + self.area.y 27 cx.move_to(ox-size, oy ) 28 cx.line_to(ox+size, oy ) 29 cx.move_to(ox , oy-size) 30 cx.line_to(ox , oy+size) 33 31 34 32 def preparePath(storeName, size=2): … … 42 40 43 41 cx.set_line_width(self.options.stroke.width) 44 # TODO: self.options.stroke.shadow45 for key in self._getDatasetsKeys():46 cx.set_source_rgb(*self.options.colorScheme[key])47 preparePath(key)48 cx.stroke()42 # TODO: self.options.stroke.shadow 43 for key in self._getDatasetsKeys(): 44 cx.set_source_rgb(*self.options.colorScheme[key]) 45 preparePath(key) 46 cx.stroke() 49 47 50 48 cx.restore() 51 49 52 50 def _renderLines(self, cx): 53 """We don't need lines in the background""" 54 pass51 # We don't need lines in the background 52 pass
