summaryrefslogtreecommitdiff
path: root/addons/web/static/src/xml/chart.xml
diff options
context:
space:
mode:
Diffstat (limited to 'addons/web/static/src/xml/chart.xml')
-rw-r--r--addons/web/static/src/xml/chart.xml39
1 files changed, 39 insertions, 0 deletions
diff --git a/addons/web/static/src/xml/chart.xml b/addons/web/static/src/xml/chart.xml
new file mode 100644
index 00000000000..a6f5cccc712
--- /dev/null
+++ b/addons/web/static/src/xml/chart.xml
@@ -0,0 +1,39 @@
+<template>
+
+<t t-name="web.PieChart">
+ <graph type="pie" t-att-title="title">
+ <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>
+
+<t t-name="web.Chart.Tooltip">
+ <table>
+ <thead>
+ <tr>
+ <td colspan="3">
+ <strong class="x-value">
+ <t t-esc="title"/>
+ </strong>
+ </td>
+ </tr>
+ </thead>
+ <tbody>
+ <t t-foreach="lines" t-as="line">
+ <tr>
+ <td class="legend-color-guide">
+ <div t-att-style="'background-color:' + line.color +';'"/>
+ </td>
+ <td class="key">
+ <t t-esc="line.label"/>
+ </td>
+ <td class="value">
+ <t t-esc="line.value &amp;&amp; window.parseFloat(line.value).toFixed(2) || 0"/>
+ </td>
+ </tr>
+ </t>
+ </tbody>
+ </table>
+</t>
+
+</template>