From 97e5da5e2aacc354021d3387afbc1d40400a6aaa Mon Sep 17 00:00:00 2001 From: Denis Ledoux Date: Fri, 9 Dec 2016 17:41:09 +0100 Subject: [PATCH] [FIX] website_links: adapt countries pie chart height With a high number of countries, the pie chart was partially hidden. We adapt the svh height according to the number of country to display. opw-691941 --- addons/website_links/static/src/js/website_links_charts.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/addons/website_links/static/src/js/website_links_charts.js b/addons/website_links/static/src/js/website_links_charts.js index 73d90ecf52b..27bb952b722 100644 --- a/addons/website_links/static/src/js/website_links_charts.js +++ b/addons/website_links/static/src/js/website_links_charts.js @@ -194,6 +194,10 @@ if(!$('.o_website_links_chart').length) { charts.last_month_pie = new PieChart('#last_month_countries_charts', last_month_clicks_by_country); charts.last_week_pie = new PieChart('#last_week_countries_charts', last_week_clicks_by_country); + var row_width = $('#all_time_countries_charts').parent().width(); + var charts_svg = $('#all_time_countries_charts,last_month_countries_charts,last_week_countries_charts').find('svg'); + charts_svg.css('height', Math.max(clicks_by_country.length * (row_width > 750 ? 1 : 2), 20) + 'em'); + _.invoke(charts, 'start'); nv.utils.windowResize(function () {