diff options
| author | Gery Debongnie <ged@openerp.com> | 2013-12-27 15:28:14 +0100 |
|---|---|---|
| committer | Gery Debongnie <ged@openerp.com> | 2013-12-27 15:28:14 +0100 |
| commit | 868be53bae50a49d86658102baa092c81e048691 (patch) | |
| tree | 80c48140d53267a5e2ec0452eacd9c2f16b208e6 /addons/web_graph/static/src/js/graph.js | |
| parent | ed4fdc51080c88c6cc289eedb86407c0587d1648 (diff) | |
[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
Diffstat (limited to 'addons/web_graph/static/src/js/graph.js')
| -rw-r--r-- | addons/web_graph/static/src/js/graph.js | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/addons/web_graph/static/src/js/graph.js b/addons/web_graph/static/src/js/graph.js index 3a6d5e8ffed..33d17e2b059 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) |
