novus / nvd3

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

Discrete Bar chart throws an error. #648

Closed kklisura closed 9 years ago

kklisura commented 10 years ago

Discrete Bar chart having a single value entry throws an "Invalid value for attribute x="NaN"" error. Really annoying.

Reproducible on livecode @ nvd3.org on Discrete Bar chart with following data set:

 [
  {
    key: "Cumulative Return",
    values: [
      { 
        "label" : "A" ,
        "value" : -29.765957771107
      }
    ]
  }
]
liquidpele commented 9 years ago

This should be fixed in my latest fork code:

https://github.com/liquidpele/nvd3/tree/development