Objects / line
line(points, [color], [fill])
line(array points)
line(array points, string color)
line(array points, bool fill)
line(array points, string color, bool fill)
line(object parameters)

Create a jCanvaScript object, which draws direct or broken lines. Array of points contains arrays with coordinates of points: [x,y]. For line creation it is required at least two arrays.
line(array points)
Code
<script type="text/javascript">
	function onload_1(idCanvas)
	{
		jc.start(idCanvas);
		jc.line([[0,0],[250,265]]);
		jc.line([[10,20],[15,32],[180,60],[92,7]]);
		jc.start(idCanvas);
	}
</script>
<canvas id="canvas_1" width="250px" height="265px">
</canvas>
View
line(array points, string color)
Code
<script type="text/javascript">
	function onload_2(idCanvas)
	{
		jc.start(idCanvas);
		jc.line([[60,20],[75,132],[220,60]],'#ff5587');
		jc.start(idCanvas);
	}
</script>
<canvas id="canvas_2" width="250px" height="265px">
</canvas>
View
line(array points, bool fill)
Code
<script type="text/javascript">
	function onload_3(idCanvas)
	{
		jc.start(idCanvas);
		jc.line([[60,20],[75,132],[220,60]],1);
		jc.line([[30,120],[175,192],[120,160]],0);
		jc.start(idCanvas);
	}
</script>
<canvas id="canvas_3" width="250px" height="265px">
</canvas>
View
line(array points, string color, bool fill)
Code
<script type="text/javascript">
	function onload_4(idCanvas)
	{
		jc.start(idCanvas);
		var arr1=[[60,20],[75,132],[220,60],[200,100]];
		var arr2=[[],[],[],[]];
		for(var i=0;i<4;i++)
		{
			arr2[i][0]=arr1[i][1];
			arr2[i][1]=arr1[i][0];
		}
		jc.line(arr1,'#55ff00',0);
		jc.line(arr2,'rgba(12,253,65,0.7)',1);
		jc.start(idCanvas);
	}
</script>
<canvas id="canvas_4" width="250px" height="265px">
</canvas>
View
line(object parameters)
Code
<script type="text/javascript">
	function onload_5(idCanvas)
	{
		jc.start(idCanvas);
		var points_5=[[60,20],[75,132],[220,60],[200,100]];
		jc.line({points:points_5,color:'rgba(12,253,65,0.7)',fill:1});
		jc.start(idCanvas);
	}
</script>
<canvas id="canvas_5" width="250px" height="265px">
</canvas>
View