1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
|
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<template id="s_chart" name="Chart">
<div class="s_chart" data-type="bar" data-legend-position="top" data-tooltip-display="true" data-stacked="false" data-border-width="2"
data-data="{
"labels":["First","Second","Third","Fourth","Fifth"],
"datasets":[
{
"label":"One",
"data":["12","24","18","17","10"],
"backgroundColor":"o-color-1",
"borderColor":"o-color-1"
}
]
}">
<h2>A Chart Title</h2>
<canvas/>
</div>
</template>
<template id="s_chart_options" inherit_id="website.snippet_options">
<xpath expr="." position="inside">
<div data-js="InnerChart" string="Chart"
data-selector=".s_chart">
<we-row string="Background">
<t t-call="web_editor.snippet_options_background_color_widget"/>
</we-row>
<we-select string="Type" data-attribute-name="type" data-attribute-default-value="bar">
<we-button data-select-data-attribute="bar" data-name="bar_chart_opt">Bar Vertical</we-button>
<we-button data-select-data-attribute="horizontalBar" data-name="horizontal_bar_chart_opt">Bar Horizontal</we-button>
<we-button data-select-data-attribute="line">Line</we-button>
<we-button data-select-data-attribute="pie">Pie</we-button>
<we-button data-select-data-attribute="doughnut">Doughnut</we-button>
<we-button data-select-data-attribute="radar">Radar</we-button>
</we-select>
<we-checkbox string="Stacked" data-name="stacked_chart_opt" data-dependencies="bar_chart_opt, horizontal_bar_chart_opt"
data-select-data-attribute="false|true" data-attribute-name="stacked" data-no-preview="true"/>
<we-select string="Legend" data-attribute-name="legendPosition" data-attribute-default-value="top">
<we-button data-select-data-attribute="none">None</we-button>
<we-button data-select-data-attribute="top">Top</we-button>
<we-button data-select-data-attribute="left">Left</we-button>
<we-button data-select-data-attribute="bottom">Bottom</we-button>
<we-button data-select-data-attribute="right">Right</we-button>
</we-select>
<we-checkbox string="Tooltip" data-select-data-attribute="false|true" data-attribute-name="tooltipDisplay" data-no-preview="true"/>
<we-matrix>
<table>
<tr>
<th/>
<th><we-button class="add_column fa fa-fw fa-plus o_we_link o_we_text_success d-inline-block"/></th>
</tr>
<tr>
<th><we-button class="add_row fa fa-fw fa-plus o_we_link o_we_text_success d-inline-block"/></th>
</tr>
</table>
</we-matrix>
<we-colorpicker string="Background" data-name="chart_bg_color_opt"
data-color-change=""
data-attribute-name="backgroundColor"
data-no-preview="true"/>
<we-colorpicker string="Border" data-name="chart_border_color_opt"
data-color-change=""
data-attribute-name="borderColor"
data-no-preview="true"/>
<we-input string="Border Width" data-select-data-attribute="2px" data-attribute-name="borderWidth" data-unit="px"/>
</div>
</xpath>
</template>
<template id="assets_snippet_s_chart_js_000" inherit_id="website.assets_frontend">
<xpath expr="//script[last()]" position="after">
<script type="text/javascript" src="/website/static/src/snippets/s_chart/000.js"/>
</xpath>
</template>
</odoo>
|