summaryrefslogtreecommitdiff
path: root/addons/web/static/src/xml
diff options
context:
space:
mode:
Diffstat (limited to 'addons/web/static/src/xml')
-rw-r--r--addons/web/static/src/xml/chart.xml39
-rw-r--r--addons/web/static/src/xml/pie_chart.xml10
2 files changed, 39 insertions, 10 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>
diff --git a/addons/web/static/src/xml/pie_chart.xml b/addons/web/static/src/xml/pie_chart.xml
deleted file mode 100644
index d45bef7af6f..00000000000
--- a/addons/web/static/src/xml/pie_chart.xml
+++ /dev/null
@@ -1,10 +0,0 @@
-<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>
-
-</template>