https://answers.unity.com/questions/1201050/is-there-way-to-have-line-renderer-on-a-canvas.html
If anyone's still looking for the answer: https://forum.unity3d.com/threads/render-lines-on-top-of-panel-ui-element.287023/
Use "Screen Space - Camera", assign the camera, and increase the width of the line so it becomes visible.