Because of the high rendering performance I am using uPlot to visualize historical sensor data. Is there a way to add horizontal reference lines like recommended min/max values for a data series? With other libraries that's often straight forward, like the ReferenceLine tag in recharts, but I haven't found anything yet with uPlot. Any hints?
Example: The orange dotted lines are the lower and upper acceptable bounds at 7.0 and 7.4. This image is rendered with recharts, but I want to migrate to uplot.
(There's a layer in front of the chart with the actual, min and max value which is totally independent of the chart.)
I found an acceptable aproach based on two examples in the uPlog repository:
https://leeoniya.github.io/uPlot/demos/trendlines.html https://leeoniya.github.io/uPlot/demos/draw-hooks.html
The main idea is to handle one of the draw-hooks (draw, drawAxes, drawClear) and to directly drawing on the canvas.