diff options
| author | Adrien Dieudonne <adr@odoo.com> | 2018-09-19 11:42:06 +0200 |
|---|---|---|
| committer | Adrien Dieudonne <adr@odoo.com> | 2018-09-20 13:30:50 +0200 |
| commit | 067754f0f6100b0b2a4bc627dbafdaf3955c8102 (patch) | |
| tree | dab74bf0878668abcf73fc98342330bec7bb533b /addons/web/static/src/xml/pie_chart.xml | |
| parent | b5a12b4aac9484cd342e29f2a0402fb148b09e2e (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.xml | 10 |
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> |
