summaryrefslogtreecommitdiff
path: root/addons/web/static
diff options
context:
space:
mode:
authorHiral Bhavsar <hbh@odoo.com>2018-12-17 12:54:29 +0000
committerMathieu Duckerts-Antoine <dam@odoo.com>2019-02-21 13:01:26 +0000
commit4b652ebe8afe05ffdce709c5e85180a1f47d68c1 (patch)
tree224f265c854b01e5609c4dfe7de44afd298ba61d /addons/web/static
parent2dd90370cd7c8e9518b44c4d9b1388016ba4d1ab (diff)
[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
Diffstat (limited to 'addons/web/static')
-rw-r--r--addons/web/static/src/js/views/graph/graph_renderer.js4
-rw-r--r--addons/web/static/src/scss/graph_view.scss8
2 files changed, 8 insertions, 4 deletions
diff --git a/addons/web/static/src/js/views/graph/graph_renderer.js b/addons/web/static/src/js/views/graph/graph_renderer.js
index 358426c86b9..2771159ab19 100644
--- a/addons/web/static/src/js/views/graph/graph_renderer.js
+++ b/addons/web/static/src/js/views/graph/graph_renderer.js
@@ -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;
diff --git a/addons/web/static/src/scss/graph_view.scss b/addons/web/static/src/scss/graph_view.scss
index 547e72ffab1..f78df83cc83 100644
--- a/addons/web/static/src/scss/graph_view.scss
+++ b/addons/web/static/src/scss/graph_view.scss
@@ -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;
+ }
+ }
}
}
}