[FIX] website_links: unreadable axis labels on statistics graphs

When there are many values, the axis would be unreadable.
We also added a margin so that the values would be displayed entirely,
as opposed to cropped in the middle of a word.

opw 1890109

closes odoo/odoo#27656
This commit is contained in:
len-odoo
2018-10-11 08:05:08 +00:00
parent d211ea5f7c
commit 12a795a7a0
@@ -61,6 +61,7 @@ if (!$('.o_website_links_chart').length) {
var chart = nv.models.lineChart()
.x(function (d) { return getDate(d); })
.y(function (d) { return getNbClicks(d); })
.margin({top: 10, right: 60, bottom: 60, left: 60})
.showYAxis(true)
.showXAxis(true);
@@ -74,7 +75,7 @@ if (!$('.o_website_links_chart').length) {
chart.yAxis
.tickFormat(d3.format("d"))
.ticks(chart_data[0]['values'].length - 1);
.ticks(Math.min(chart_data[0]['values'].length - 1, 10));
d3.select(self.$element + ' svg')
.datum(chart_data)