From 9d0c8a43cdcfb5ee7c30897495b4617d58f98386 Mon Sep 17 00:00:00 2001 From: zsloan Date: Mon, 18 May 2020 11:48:50 -0500 Subject: Fixed Bar Chart left margin issue and fixed issue where 0 values didn't have +1 added when doing log transforms --- wqflask/wqflask/static/new/javascript/show_trait.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/wqflask/wqflask/static/new/javascript/show_trait.js b/wqflask/wqflask/static/new/javascript/show_trait.js index 785e5332..2f276021 100644 --- a/wqflask/wqflask/static/new/javascript/show_trait.js +++ b/wqflask/wqflask/static/new/javascript/show_trait.js @@ -758,7 +758,7 @@ check_for_zero_to_one_vals = function() { return; } else { current_value = parseFloat(current_value) - if (0 < current_value && current_value < 1){ + if (0 <= current_value && current_value < 1){ zero_to_one_vals_exist = true return false; } @@ -1033,12 +1033,16 @@ val_range = root.chart_range[1] - root.chart_range[0] if (val_range < 0.05){ tick_digits = '.3f' + left_margin = 80 } else if (val_range < 0.5) { tick_digits = '.2f' + left_margin = 70 } else if (val_range < 5){ tick_digits = '.1f' + left_margin = 60 } else { tick_digits = 'f' + left_margin = 55 } if (js_data.num_values < 256) { @@ -1077,7 +1081,7 @@ if (js_data.num_values < 256) { width: bar_chart_width, height: 600, margin: { - l: 55, + l: left_margin, r: 30, t: 30, b: bottom_margin -- cgit v1.2.3