所以我使用recharts创建了这个图表:

有没有办法删除 YAxis 线但保持值可见?比如删除线路但保留 135、190 等。
<div className={styles.lineChart}>
<h3 className={styles.title}>Body Weight</h3>
<LineChart
width={800}
height={300}
data={props.data}
margin={{
top: 5, right: 30, left: 20, bottom: 5,
}}
>
<CartesianGrid strokeDasharray="3 3" />
<XAxis dataKey="day" />
<YAxis />
<Tooltip />
<Legend layout="horizontal" verticalAlign="top" align="center"/>
<Line type="monotone" dataKey="body weight" stroke="#57c0e8" activeDot={{ r: 8 }} />
</LineChart>
</div>
Run Code Online (Sandbox Code Playgroud)
Orl*_*yyn 24
要隐藏 YAxis 线,只需使用axisLineYAxis 上的 props,并将其设置为false。
像这样:
<YAxis axisLine={false} />
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
13540 次 |
| 最近记录: |