Skip to content

Commit

Permalink
Don't force formatting when using "Period Ratio" (#668)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
mistercrunch committed Jun 23, 2016
1 parent 4a8e62b commit e230d9d
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions caravel/assets/visualizations/nvd3_vis.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit e230d9d

Please sign in to comment.