novus / nvd3

A reusable charting library written in d3.js
http://nvd3.org/
Other
7.22k stars 2.15k forks source link

y-axis [-1, +1] range on stacked area chart when all data is zero #1232

Open raybellis opened 9 years ago

raybellis commented 9 years ago

Someone else has a similar problem described at http://stackoverflow.com/questions/22172494 with no apparently working solution.

I have a stackedAreaChart where all the values are initial zero, and all valid values are positive. However the initial range always starts as [-1, +1], which looks pretty ugly.

liquidpele commented 9 years ago

just start off with the values at 0.0001 or something... I think d3 is just trying to guess at the range and since you're all zeros it doesn't know if it should favor positive or negative.

raybellis commented 9 years ago

Hmm, I tried that but it hasn't worked. Do you think this is an underlying D3 problem rather than nvd3?