Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Questions about area charts and stacked charts. #400

Open
arafat813 opened this issue Oct 16, 2024 · 0 comments
Open

Questions about area charts and stacked charts. #400

arafat813 opened this issue Oct 16, 2024 · 0 comments

Comments

@arafat813
Copy link

  1. When I use an area chart, I want a gradient effect, but after following the example to implement it, I found it doesn't work.
    this is my code
    <CartesianChart data={chartData.current} xKey="day" yKeys={['highTmp']} domainPadding={{ left: 20, }} // 👇 pass the font, opting in to axes. yAxis={[ { font, axisSide: 'right', lineWidth: 0, }, ]} xAxis={{ font, tickCount: 3, lineWidth: 0, }}> {({points, chartBounds}) => ( <> <Area points={points.highTmp} y0={chartBounds.bottom} animate={{ type: 'timing', // 动画类型 duration: 1000, // 动画时长 }}> <LinearGradient start={vec(0, 0)} // 👈 The start and end are vectors that represent the direction of the gradient. end={vec(0, 400)} colors={[ // 👈 The colors are an array of strings that represent the colors of the gradient. '#a78bfa', '#a78bfa50', // 👈 The second color is the same as the first but with an alpha value of 50%. ]} /> </Area> </> )} </CartesianChart>

2.When using a stacked chart, I would like to swap the positions of the x-axis and y-axis to display the stacked chart horizontally, but I couldn't find any examples in the official documentation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant