equal
deleted
inserted
replaced
11 import time |
11 import time |
12 |
12 |
13 from simplejson import dumps |
13 from simplejson import dumps |
14 |
14 |
15 from logilab.common import flatten |
15 from logilab.common import flatten |
16 from logilab.mtconverter import html_escape |
16 from logilab.mtconverter import xml_escape |
17 |
17 |
18 from cubicweb.utils import make_uid, UStringIO, datetime2ticks |
18 from cubicweb.utils import make_uid, UStringIO, datetime2ticks |
19 from cubicweb.vregistry import objectify_selector |
19 from cubicweb.vregistry import objectify_selector |
20 from cubicweb.web.views import baseviews |
20 from cubicweb.web.views import baseviews |
21 |
21 |
165 if width is not None: |
165 if width is not None: |
166 height = height or width |
166 height = height or width |
167 piechart.size(width, height) |
167 piechart.size(width, height) |
168 if self.title: |
168 if self.title: |
169 piechart.title(self.title) |
169 piechart.title(self.title) |
170 self.w(u'<img src="%s" />' % html_escape(piechart.url)) |
170 self.w(u'<img src="%s" />' % xml_escape(piechart.url)) |
171 |
171 |
172 class PieChartView(baseviews.AnyRsetView): |
172 class PieChartView(baseviews.AnyRsetView): |
173 id = 'piechart' |
173 id = 'piechart' |
174 pieclass = Pie |
174 pieclass = Pie |
175 |
175 |