ant-design / ant-design-charts

A React Chart Library
https://ant-design-charts.antgroup.com/
MIT License
1.95k stars 364 forks source link

🐛[BUG] #290

Closed maacl closed 4 years ago

maacl commented 4 years ago

Sorry I don't read chinese so I am not following the template, but I will try to provide all relevant information.

I am using @ant-design/charts version 1.0.3.

colorField / color on Column chart is broken as the x-value is always passed to the color function not the colorField key.

This used to work until I reinstalled dependencies so I think this might be caused by a @ant-design/charts dependency.

Happy to provide more information if needed.

lxfu1 commented 4 years ago

Column not support colorField, use seriesField or color.

// method one
color: ['red', 'blue']

color: (item)=> 'red'

// method two
seriesField: 'xxx'
maacl commented 4 years ago

Thank you, using seriesField works, but please note that if seriesField is not used color: (item)=> is only passed x-field, not the complete item.