简体   繁体   English

Plot 图表上同一行的两条线

[英]Plot two lines on the same row on a graph

I am trying to create a medical graph to display the heart rate.我正在尝试创建一个医学图表来显示心率。 It will have the live data on the left part and the prediction forecast on the right.它将在左侧显示实时数据,在右侧显示预测预测。 I will get both from the backend API, and I need now to show them as one line on the graph.我将从后端 API 获取两者,现在我需要在图表上将它们显示为一条线。 I am using ReactJs and chart.JS.我正在使用 ReactJs 和 chart.JS。 Look the picture below to understand better: ( https://i.stack.imgur.com/qWd6H.jpg )tter:看下面的图片可以更好地理解:( https://i.stack.imgur.com/qWd6H.jpg )tter:

I just tried to do the regression but it will be done from the backend.我只是尝试进行回归,但它将从后端完成。 I am getting from the API two fields: live data: and prediction: And I need them to add them together.我从 API 得到两个字段:实时数据:和预测:我需要将它们加在一起。

I think you can use segment option for this.我认为您可以为此使用segment选项。 You can change line styles based on datapoint options / value.您可以根据数据点选项/值更改 styles 行。 Usage example: Link an official example使用示例: 链接一个官方示例

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在MATLAB中的一张图中绘制两条线? - How to plot two lines in one graph in MATLAB? 如何在同一图表上绘制两个DataFrame以进行比较 - How to plot two DataFrame on same graph for comparison 如何使用两种不同的颜色在iGraph中绘制两次相同的图形 - How to plot the same graph in iGraph two times with two different colorings 在同一张图上使用 ggplot2 将两个变量绘制为线 - Plotting two variables as lines using ggplot2 on the same graph Plot 一张图中的两条线,每条线都有自己的 y 值 - Plot two lines in one graph with each line own y-values Pyplot - 当一个轴的列表长度不一致时,我如何在同一图表上 plot 多条线? - Pyplot - How do I plot multiple lines on the same graph when list lengths for one axis are not consistent? 在同一图上绘制函数和散点图 - Plot function and Scatter on the same graph 如何在单个图形python中绘制多条线 - How to plot multiple lines in single graph python 如何使用ggplot在同一图表上绘制具有两种不同颜色方案的两组数据? - How to plot two sets of data with two different color schemes on the same graph using ggplot? 使用plot()而不是lines()时,R中的线图中未显示的线 - lines not showing up on line graph in R when using plot() then lines()
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM