You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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.
The text was updated successfully, but these errors were encountered: