novus / nvd3

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

Negative Values in Sunburst Chart #1384

Open Crenshinibon opened 8 years ago

Crenshinibon commented 8 years ago

Hi,

I recently learned that the chart really behaves and looks strange when the underlying data, that get's pulled for calculating the arcs sizes, has negative values. I stumbled across this, because I implemented a 'diff' sunburst.

I fixed it with 'Math.abs', but I'm not sure if the lib should do something about it or if the user has to provide sane data? In the latter case, I guess we have to document that somewhere.

Regards Dirk

liquidpele commented 8 years ago

Hmm, yea, that's a strange one... not sure negative values are really all that valid for a sunburst chart, I dunno. Math.abs() could make the most sense I guess, if you consider all values to just be a magnitude away from nothing.