简体   繁体   中英

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. I am using ReactJs and chart.JS. Look the picture below to understand better: ( 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.

I think you can use segment option for this. You can change line styles based on datapoint options / value. Usage example: Link an official example

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM