From 790b798ec489c73fd5241c246590a264aad8d93d Mon Sep 17 00:00:00 2001 From: Maxime Beauchemin Date: Wed, 22 Jun 2016 23:55:06 -0700 Subject: [PATCH] Don't force formatting when using "Period Ratio" At the moment, when using the "Period Ratio" option, a percentage formatting is forced on the Y Axis. This code pre-dates the `Y Axis Format` option. People may want to see a growth rate, in which case the current `.3p` isn't what they want, or they may want only 2 digits of precision or whatever else. This PR allows that. --- caravel/assets/visualizations/nvd3_vis.js | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/caravel/assets/visualizations/nvd3_vis.js b/caravel/assets/visualizations/nvd3_vis.js index 7408c9912b1b..67bd6f7df9b2 100644 --- a/caravel/assets/visualizations/nvd3_vis.js +++ b/caravel/assets/visualizations/nvd3_vis.js @@ -213,12 +213,7 @@ function nvd3Vis(slice) { chart.yAxis.tickFormat(d3.format('.3s')); } - if (fd.contribution || fd.num_period_compare || viz_type === 'compare') { - chart.yAxis.tickFormat(d3.format('.3p')); - if (chart.y2Axis !== undefined) { - chart.y2Axis.tickFormat(d3.format('.3p')); - } - } else if (fd.y_axis_format) { + if (fd.y_axis_format) { chart.yAxis.tickFormat(d3.format(fd.y_axis_format)); if (chart.y2Axis !== undefined) {