[IMP] web: properly display min and max abs when less that 3 abs.

In graph line mode, min and max abs are
displayed beyond the screen when there are less
than 3 abs.
This is happening because nvd3 fixes their
text-anchor to 'middle'. The present commit fixes
correctly their text-anchors to start and end
respectively by using the '!important' rule (it
seems difficult to do otherwise).

Co-authored-by: Mohammed Shekha <msh@openerp.com>

Related to Task: 1917958
This commit is contained in:
Hiral Bhavsar
2019-02-21 13:01:26 +00:00
committed by Mathieu Duckerts-Antoine
co-authored by Mohammed Shekha
parent 2dd90370cd
commit 4b652ebe8a
2 changed files with 8 additions and 4 deletions
@@ -451,10 +451,6 @@ return AbstractRenderer.extend({
// of the tiny margins.
if (ticksLabels.length > 3) {
$svgContainer.find('svg .nv-x g.nv-axisMaxMin-x > text').hide();
} else {
// Since the graph is on full container have first and last label in the container
$svgContainer.find('svg .nv-x g.nv-axisMin-x > text').css({'text-anchor': 'start'});
$svgContainer.find('svg .nv-x g.nv-axisMax-x > text').css({'text-anchor': 'end'});
}
return chart;
@@ -24,6 +24,14 @@
// ligther area color
fill-opacity: 0.1;
}
.nv-lineChart .nv-x.nv-axis .nv-axisMaxMin-x {
&.nv-axisMin-x text {
text-anchor: start !important;
}
&.nv-axisMax-x text {
text-anchor: end !important;
}
}
}
}
}