Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/charts.py
diff options
context:
space:
mode:
authorManuel QuiƱones <manuq@laptop.org>2012-02-07 15:15:48 (GMT)
committer Agustin Zubiaga <aguzubiaga97@gmail.com>2012-02-07 15:26:59 (GMT)
commite5fd914f1862da5dfaf957f211b29570f7c1579e (patch)
tree017701a5786201ef7fc720be191044005620b3e1 /charts.py
parent7360f11bee3eceaa42b5a1f18abb2ce04d79daf5 (diff)
Use cairo surface directly to show the chart in the canvas
Signed-off-by: Manuel QuiƱones <manuq@laptop.org> Signed-off-by: Agustin Zubiaga <aguzubiaga97@gmail.com>
Diffstat (limited to 'charts.py')
-rw-r--r--charts.py8
1 files changed, 3 insertions, 5 deletions
diff --git a/charts.py b/charts.py
index e291d2b..35fc44a 100644
--- a/charts.py
+++ b/charts.py
@@ -32,10 +32,6 @@ CHART_IMAGE = os.path.join("/tmp", "chart.png")
class Chart(gobject.GObject):
-
- __gsignals__ = {
- 'ready': (gobject.SIGNAL_RUN_FIRST, None, [str])}
-
def __init__(self, type="vertical", width=600, height=460):
gobject.GObject.__init__(self)
@@ -119,5 +115,7 @@ class Chart(gobject.GObject):
chart.addDataset(self.dataSet)
chart.render()
+ def as_png(self):
+ # FIXME, don't use a temporal file
self.surface.write_to_png(CHART_IMAGE)
- self.emit("ready", CHART_IMAGE)
+ return CHART_IMAGE