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; + } + } } } }