summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenis Ledoux <dle@odoo.com>2016-12-09 17:41:09 +0100
committerDenis Ledoux <dle@odoo.com>2016-12-09 17:42:25 +0100
commit97e5da5e2aacc354021d3387afbc1d40400a6aaa (patch)
tree723ff38e26a683349e33306ac9678e195da8b1cc
parent9c8422a405fb7631fa9fb1171286ca134cacad62 (diff)
[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
-rw-r--r--addons/website_links/static/src/js/website_links_charts.js4
1 files changed, 4 insertions, 0 deletions
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 () {