codesuki / react-d3-components

D3 Components for React
http://codesuki.github.io/react-d3-components/example.html
MIT License
1.63k stars 206 forks source link

I want to pass xscale value to Bar Chart, how to achieve that! #171

Open vchandwani opened 5 years ago

vchandwani commented 5 years ago

I want to pass xscale value to Bar Chart, how to achieve that! I am trying to create stacked Bar Chart My X-scale values are date and I want to escape few value to be shown.

I am passing data as below data : [ { label: 'Test', values: [{x: new Date(2019, 2, 5,9,10), y: 1 }, {x: new Date(2019, 2, 5,9,20), y: 5}, {x: new Date(2019, 2, 5,9,30), y: 1}] }, { label: 'Test1', values: [{x: new Date(2019, 2, 5,9,10), y: 6}, {x: new Date(2019, 2, 5,9,20), y: 4}, {x: new Date(2019, 2, 5,9,30), y: 2}] } ] and getting error "TypeError: xScale.rangeBand is not a function" My xscale is xScale: d3.time.scale().domain([new Date(2019,2,5,9,0), new Date(2019,2,5,14,0)]).range([0, 400 - 70]),