react-d3 / react-d3-basic

Basic d3 charts in React.js, only include: line, bar, pie, scatter, area charts.
http://reactd3.org/docs/basic
221 stars 117 forks source link

BarChart with time xScale fails #29

Open Guibod opened 8 years ago

Guibod commented 8 years ago

Bar relies on Xscale.bandwidth() that is not available in a Time scale.

chilijung commented 8 years ago

Hi, @Guibod, why are you using time scale while you are using Bar chart? I'm suppose that passing an ordinal scale in Xscale.

see example here:

https://github.com/react-d3/react-d3-shape/blob/master/example/src/bar.jsx#L26

Guibod commented 8 years ago

From my beginner point of view it sounded pretty smart to use a Time scale in an histogram, yet it was stupid in the logic universe. Programmatically speaking it is still a possibility, you may need to assert scale type in the API since some unaware people (like myself) don't understand what they are doing sometimes. :)

chilijung commented 8 years ago

Yeah, your right! Actually I've been really busy these days and there are many documents that haven't arrange yet. I'll do it when I have time. Thanks.