The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript Line graph – joining the dots (responsive) Reply To: Line graph – joining the dots (responsive)


Half the height of the line is a nice estimate (which you used). I think you’d need to use cos(angle) and sin(angle) multiplied with half the width of the lines for the left and top respectively. I havn’t tested yet though. In my example the lines had a width of 1 px so I just neglected doing so.