summaryrefslogtreecommitdiff
path: root/addons/web/static/src/xml/pie_chart.xml
diff options
context:
space:
mode:
authorAdrien Dieudonne <adr@odoo.com>2018-09-19 11:42:06 +0200
committerAdrien Dieudonne <adr@odoo.com>2018-09-20 13:30:50 +0200
commit067754f0f6100b0b2a4bc627dbafdaf3955c8102 (patch)
treedab74bf0878668abcf73fc98342330bec7bb533b /addons/web/static/src/xml/pie_chart.xml
parentb5a12b4aac9484cd342e29f2a0402fb148b09e2e (diff)
[REF] web: Use graph renderer to render pie_chart widget
Before this rev., the pie_chart widget was rendered from scratch with nv.d3 and we had duplicated code. In comparison mode, two widgets were instancied and it was a bit difficult to synchronize the size of these svg graphs. nv.d3 graphs are attached when the dom is ready because it needs to calculate the available space. UI bugs can appear if the dom changes... .update() must be executed on the graph to avoid this as we already do in graph renderer. So now, the rendering of the pie_chart widget is done by the graph renderer. As comparaison mode is supported by the rendering, only one widget needs to be instancied. Task ID: 1835644
Diffstat (limited to 'addons/web/static/src/xml/pie_chart.xml')
-rw-r--r--addons/web/static/src/xml/pie_chart.xml10
1 files changed, 10 insertions, 0 deletions
diff --git a/addons/web/static/src/xml/pie_chart.xml b/addons/web/static/src/xml/pie_chart.xml
new file mode 100644
index 00000000000..31f31b5b8d2
--- /dev/null
+++ b/addons/web/static/src/xml/pie_chart.xml
@@ -0,0 +1,10 @@
+<template>
+
+<t t-name="web.PieChart">
+ <graph type="pie">
+ <field t-att-name="modifiers.groupby.split(':')[0]" t-att-interval="modifiers.groupby.split(':')[1]"/>
+ <field t-if="modifiers.measure" t-att-name="modifiers.measure" type="measure"/>
+ </graph>
+</t>
+
+</template>