Forum Discussion
KythrieSilva-cd
3 years agoCommunity Member
Can you draw a line with Javascript in Storyline 360?
Hi, Is it possible to draw a line on the screen using JavaScript in Storyline 360?
I'm working on a statistics example where I want to draw a regression line on a scatterplot. The learner can add ...
ChrisCurry
2 years agoCommunity Member
Sorry, there was a bit of confusion on what I was asking. "ctx.lineWidth" effects how thick the line is obviously. I was talking about where the line ends. The total size of the line.
If I understand the code correctly, "ctx.moveto" indicates the starting point of the line, and "ctx.lineto" will be the point to where the line will draw to. In my second example above, I changed the "x" position of the line to "ctx.lineto(1200, 120)" (much longer than the width of the slide which is 960). However it still travels the same distance as the first example, which is set to "ctx.lineto(300, 120)".
Apologies for any confusion in my original question. Thanks!