Fixing a regression issue with #1824. Also removing duplicate code

This opens and closes #1824.

After more testing, I realized that I set the bounds too low for the `n` format for the y-axis. Here I increase it to 100. I also remove some duplicate code in the `data.js` module.