VisActor / VChart

VChart, more than just a cross-platform charting library, but also an expressive data storyteller.
https://www.visactor.io/vchart
MIT License
914 stars 62 forks source link

[Bug] react-vchart BarChart cannot work while set direction="horizontal" #2634

Closed hunter-xue closed 4 months ago

hunter-xue commented 4 months ago

Version

1.10.5

Link to Minimal Reproduction

https://github.com/VisActor/VChart/tree/main/packages/react-vchart

Steps to Reproduce

return (
    <div>
        <BarChart ref={chartRef} data={[{ id: 'chat_bar', values: barData }]}>
            <Bar
                seriesField="category"
                xField="count"
                yField="dept"
                direction="horizontal"
                stack={true}
                percent={true}
            />
            <Axis orient="bottom" />
            <Legend visible={true} position="start" orient="top" padding={{ bottom: 12 }} />
        </BarChart>
    </div>
);

Current Behavior

horizontal does NOT work, but vetical working well.

Expected Behavior

horizontal working well.

Environment

- OS:MacOS
- Browser: Edge
- Framework: Vite and Yarn 2

Any additional comments?

No response

xile611 commented 4 months ago

@hunter-xue

direction="horizontal" 是图表级别的配置,要如下配置:

<BarChart  direction="horizontal">
...