From: Gery Debongnie Date: Fri, 27 Dec 2013 14:28:14 +0000 (+0100) Subject: [IMP] incline the x-axis text by 15 degree when there are too many bars to display... X-Git-Tag: InsPy_master01~620^2~78 X-Git-Url: http://git.inspyration.org/?a=commitdiff_plain;ds=sidebyside;h=868be53bae50a49d86658102baa092c81e048691;p=odoo%2Fodoo.git [IMP] incline the x-axis text by 15 degree when there are too many bars to display in a bar chart. Also, reduces the number of 'ticks' displayed (addon web_graph) bzr revid: ged@openerp.com-20131227142814-8ktqqxlthfa5hxe8 --- diff --git a/addons/web_graph/static/src/js/graph.js b/addons/web_graph/static/src/js/graph.js index 3a6d5e8..33d17e2 100644 --- a/addons/web_graph/static/src/js/graph.js +++ b/addons/web_graph/static/src/js/graph.js @@ -578,9 +578,15 @@ instance.web_graph.Graph = instance.web.Widget.extend({ var chart = nv.models.multiBarChart() .width(self.width) .height(self.height) + .reduceXTicks(false) .stacked(self.bar_ui === 'stack') .staggerLabels(true); + if (self.width / data[0].values.length < 100) { + chart.rotateLabels(-15); + chart.reduceXTicks(true); + chart.margin({bottom:40}); + } if (dim_x === 1 && dim_y === 0) { chart.showControls(false); } d3.select(self.svg)