[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
This commit is contained in:
Gery Debongnie 2013-12-27 15:28:14 +01:00
parent ed4fdc5108
commit 868be53bae
1 changed files with 6 additions and 0 deletions

View File

@ -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)