recharts:使用a< brush />使用自定义X轴tick ticks;
我一直在尝试使用recharts
在react
中创建图表,并且在使用&lt;时,我一直在使用自定义的X轴tick渲染呈现相同的问题。刷 /&gt; < /code>组件。
我有大部分数据要显示1天:[{date:'9:30',value:1},{date:'9:35',value:2},...]
每小时也会分别生成X轴壁虱:['9:00','10:00',...]
如果我不使用刷子使用Zoom看起来像 this ,但是当我试图缩放以查看特定时间范围时,所有tick tick都消失了但是一个
I've been trying to create a chart with recharts
in react
and I keep on getting the same issue with custom x-axis ticks rendering when using the <Brush />
component.
I have a chunk of data to display for 1 day: [{ date: '9:30', value: 1 }, { date: '9:35', value: 2 }, ...]
There are also x-axis ticks for every hour generated separately: ['9:00', '10:00', ...]
If I don't use zoom with the brush it looks like
this but when I'm trying to zoom-in to see a specific time range all ticks disappear but one ????.
I can get the brush to work without custom ticks but I really need to show only hours without any intermediate values like 9:45
on the x-axis. Would be very glad to hear any feedback.
React v17.0.2
Recharts v2.1.9
Chrome Version 103.0.5060.53 (Official Build) (x86_64)
This example in a sandbox: https://codesandbox.io/s/simple-area-chart-forked-4kojl9?file=/src/App.tsx
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论