equal
deleted
inserted
replaced
17 # with CubicWeb. If not, see <http://www.gnu.org/licenses/>. |
17 # with CubicWeb. If not, see <http://www.gnu.org/licenses/>. |
18 """basic plot views""" |
18 """basic plot views""" |
19 |
19 |
20 __docformat__ = "restructuredtext en" |
20 __docformat__ = "restructuredtext en" |
21 _ = unicode |
21 _ = unicode |
|
22 |
|
23 from six.moves import range |
22 |
24 |
23 from logilab.common.date import datetime2ticks |
25 from logilab.common.date import datetime2ticks |
24 from logilab.common.deprecation import class_deprecated |
26 from logilab.common.deprecation import class_deprecated |
25 from logilab.common.registry import objectify_predicate |
27 from logilab.common.registry import objectify_predicate |
26 from logilab.mtconverter import xml_escape |
28 from logilab.mtconverter import xml_escape |
152 # XXX try to make it work with unions |
154 # XXX try to make it work with unions |
153 varnames = [var.name for var in rqlst.children[0].get_selected_variables()][1:] |
155 varnames = [var.name for var in rqlst.children[0].get_selected_variables()][1:] |
154 abscissa = [row[0] for row in self.cw_rset] |
156 abscissa = [row[0] for row in self.cw_rset] |
155 plots = [] |
157 plots = [] |
156 nbcols = len(self.cw_rset.rows[0]) |
158 nbcols = len(self.cw_rset.rows[0]) |
157 for col in xrange(1, nbcols): |
159 for col in range(1, nbcols): |
158 data = [row[col] for row in self.cw_rset] |
160 data = [row[col] for row in self.cw_rset] |
159 plots.append(filterout_nulls(abscissa, data)) |
161 plots.append(filterout_nulls(abscissa, data)) |
160 plotwidget = FlotPlotWidget(varnames, plots, timemode=self.timemode) |
162 plotwidget = FlotPlotWidget(varnames, plots, timemode=self.timemode) |
161 plotwidget.render(self._cw, width, height, w=self.w) |
163 plotwidget.render(self._cw, width, height, w=self.w) |
162 |
164 |