yang-wei / rd3

react + d3
https://yang-wei.github.io/rd3/
MIT License
319 stars 83 forks source link

LineChart domain error: <path> attribute d: Expected number, "MZ". #61

Closed jdelafon closed 8 years ago

jdelafon commented 8 years ago

When the domain prop is given incorrectly to a LineChart (I just cannot figure it out), it throws

Error: <path> attribute d: Expected number, "MZ".

which is not very helpful. A better error message would be welcome.

yang-wei commented 8 years ago

Can you submit a js fiddle ?

jdelafon commented 8 years ago

I can't reproduce, sorry :( If you can tell me roughly what it means, I can try to find it again.

yang-wei commented 8 years ago

In SVG <path> element, you can set the attribute d to describe the path.

https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/d

In rd3, we provide the attribute d by determining your x and y value. Like here https://github.com/yang-wei/rd3/blob/master/src/areachart/DataSeries.jsx#L25

So probably there are some invalid x and y value in your data ?