From e5fd914f1862da5dfaf957f211b29570f7c1579e Mon Sep 17 00:00:00 2001 From: Manuel QuiƱones Date: Tue, 07 Feb 2012 15:15:48 +0000 Subject: Use cairo surface directly to show the chart in the canvas Signed-off-by: Manuel QuiƱones Signed-off-by: Agustin Zubiaga --- (limited to 'charts.py') 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 -- cgit v0.9.1