reactjs - 如何使用胜利做实时图表?
问题描述
我可以知道如何使用胜利来制作实时折线图吗?
胜利库:https ://github.com/FormidableLabs/victory
<div className="chart-header">Temperature</div>
<VictoryChart
theme={VictoryTheme.material}
width={1500}
>
<VictoryLine
style={{
data: { stroke: "#c43a31" },
parent: { border: "1px solid #ccc"}
}}
labelComponent={<VictoryTooltip />}
data={temperatureData}
x="timestamp"
y="temperature"
labels={p => `${p.timestamp} $${p.temperature}`}
/>
</VictoryChart>
</div>
这是添加新温度时,它会自动更新到图表中。现在我将它与 Redux 一起使用,我使用的后端是环回。我可以知道如何实时进行吗?谢谢你。
解决方案
推荐阅读
- android - android客户端如何与PC上的服务器通信?
- python - 在 R 中加载数据时嵌入 Nul(s)
- jdbc - 表插入性能瓶颈亚马逊红移
- javascript - 如何在第二次单击时获得一个 Javascript 按钮以更改自身的类和 * 有时 * 在包含相同类的其他按钮上
- r - 有没有办法将 R 打印输出作为字符串?
- google-cloud-platform - 在谷歌云平台不同项目的虚拟机实例之间传输数据的最佳方式
- ffmpeg - 如何从碎片化的mp4中获取帧信息
- java - 具有 H2 数据库的 Spring Boot 应用程序中的反应式和非反应式存储库
- node.js - 无法使用 eslint-config-airbnb 解析依赖关系树
- c# - 无法在 .net core 3.1 Web 应用程序中检索声明主体