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

When are you gonna new release for legend? #92

Closed codewoorigil closed 6 years ago

codewoorigil commented 8 years ago

I want to use this componets on my project. But Legend is not working. I know you've already had a plan about that. I wonder when are you gonna finish to develop it.

Tell me your new release plan.

Thanks.

codesuki commented 8 years ago

Probably not any time soon since it's very easy to make custom legends by accessing the scales / data.

Martindelataille commented 8 years ago

@codesuki Could you provide an example to access the scales / data ?

Thanks

codesuki commented 8 years ago

@Martindelataille Just pass your own like this example:

var xScale = d3.scale.ordinal(); //... + set it up appropriately
var yScale = d3.scale.linear();
var colorScale = d3.scale.category20();

<BarChart xScale={xScale}
      yScale={yScale}
      colorScale={colorScale}
      barPadding={0.3}
      data={data}
      width={400}
      height={400}
      margin={{top: 10, bottom: 50, left: 50, right: 10}}/>

Then you know which color will be used. (The color is just chosen linearly from the color array). Does that help?

mycodebucket commented 7 years ago

could you please , give some complete example. i am getting ":Error: attribute height: A negative value is not valid. ("-1")"

mycodebucket commented 7 years ago

I am passing the values , as you have mentioned above. what you mean by "set it up appropriately". could you give some example on that?