diff options
| author | Christophe Simonis <chs@odoo.com> | 2016-05-24 14:08:42 +0200 |
|---|---|---|
| committer | Christophe Simonis <chs@odoo.com> | 2016-05-24 14:08:42 +0200 |
| commit | e641d740d7a3d3fb72e27e41886fd57801a3b748 (patch) | |
| tree | c5647f2b1ffba4aa575b802cab67e4a5686d4359 /addons/web/static/src | |
| parent | d4f8096790e3a76e3219d37ea17a7154b426d2fe (diff) | |
| parent | fac4cc7006e5d72a5f6ee261e8a7422c78f5e6fb (diff) | |
[MERGE] forward port of branch saas-10 up to fac4cc7
Diffstat (limited to 'addons/web/static/src')
| -rw-r--r-- | addons/web/static/src/js/views/graph_widget.js | 6 | ||||
| -rw-r--r-- | addons/web/static/src/xml/base.xml | 4 |
2 files changed, 7 insertions, 3 deletions
diff --git a/addons/web/static/src/js/views/graph_widget.js b/addons/web/static/src/js/views/graph_widget.js index e3786408125..e2c92535b23 100644 --- a/addons/web/static/src/js/views/graph_widget.js +++ b/addons/web/static/src/js/views/graph_widget.js @@ -163,7 +163,9 @@ return Widget.extend({ svg.transition().duration(0); var chart = nv.models.multiBarChart(); + var maxVal = _.max(values, function(v) {return v.y}) chart.options({ + margin: {left: 12 * String(maxVal && maxVal.y || 0).length}, delay: 250, transition: 10, showLegend: _.size(data) <= MAX_LEGEND_LENGTH, @@ -293,8 +295,9 @@ return Widget.extend({ svg.transition().duration(0); var chart = nv.models.lineChart(); + var maxVal = _.max(values, function(v) {return v.y}) chart.options({ - margin: {left: 50, right: 50}, + margin: {left: 12 * String(maxVal && maxVal.y || 0).length, right: 50}, useInteractiveGuideline: true, showLegend: _.size(data) <= MAX_LEGEND_LENGTH, showXAxis: true, @@ -302,6 +305,7 @@ return Widget.extend({ }); chart.xAxis.tickValues(tickValues) .tickFormat(tickFormat); + chart.yAxis.tickFormat(function(d) { return openerp.web.format_value(d, { type : 'float' });}); chart(svg); this.to_remove = chart.update; diff --git a/addons/web/static/src/xml/base.xml b/addons/web/static/src/xml/base.xml index a75e4d994ed..51afa847b14 100644 --- a/addons/web/static/src/xml/base.xml +++ b/addons/web/static/src/xml/base.xml @@ -902,7 +902,7 @@ <t t-if="widget.get('effective_readonly')"> <div t-foreach="widget.get('value')" t-as="id"> <t t-set="file" t-value="widget.data[id]"/> - <a t-att-href="file.url" t-attf-title="#{(file.name || file.filename) + (file.date?' \n('+file.date+')':'' )}"><t t-raw="file.name || file.filename"/></a> + <a target="_blank" t-att-href="file.url" t-attf-title="#{(file.name || file.filename) + (file.date?' \n('+file.date+')':'' )}"><t t-raw="file.name || file.filename"/></a> </div> </t> <t t-if="!widget.get('effective_readonly')"> @@ -919,7 +919,7 @@ <a href="#" class="fa fa-times pull-right oe_delete" title="Delete this file" t-att-data-id="file.id"/> <t t-raw="file.name || file.filename"/> </div> - <a class="o_image" t-att-href="file.url" + <a class="o_image" target="_blank" t-att-href="file.url" t-att-title="(file.name || file.filename) + ((file.date)? (' \n(' + file.date + ')') : '')" t-att-data-mimetype="file.mimetype" t-attf-data-src="/web/image/#{file.id}/100x80"/> |
