Reputation: 227
I have an array of objects that looks like this
[{type: 'apples', sales: 52},
{type: 'apples', sales: 62},
{type: 'apples', sales: 72}]
I want to build a column chart from Ant Design Charts with this data but instead of 3 columns, I have only one.
I don't see how to make it display each record separately.
Here is a code https://codesandbox.io/s/goofy-wind-i06ul?file=/App.tsx
Thank you for your help!
Upvotes: 0
Views: 1711
Reputation: 11
just need to add:
isStack: true,
var config = { data: data, xField: "type", yField: "sales", isStack: true, xAxis: { label: { autoHide: true, autoRotate: false } } };
Upvotes: 1