echarts可以去掉边距吗_recharts - 防止图表溢出到边距? - SO中文参考 - www.soinside.com...

我想显示最近的N点,但是当将域设置为小于chartData.length的任何值时,图表会向左溢出。

我看到我可以通过将margin={{left:59}}添加到来将所有内容向左移动,但这似乎有点不客气。有没有更好的方法可以隐藏这条溢出线?

/*

* NOTE: the axis `domain` requires a _function_ if you want to display less than the total number of

* data points (see: https://stackoverflow.com/questions/53751564/can-i-set-the-recharts-axis-domain-max-lower-than-datamax)

*/

const pointsToDisplay = 8;

const xAxisStart = chartData.length - pointsToDisplay;

return (

xAxisStart, 'dataMax']} />

);

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值