The moveTo function

Share RGraph:   To help my Google visibility (it can't get much worse!), if you like and use RGraph I'd appreciate it if you could link to me

The moveTo function is used whilst drawing paths to the canvas to move the 'pen' to a new set of coordinates without drawing a line between them. Like the lineTo function, only a single pair of X/Y coordinates are given to the function. With some of the path functions (eg bezierCurveTo, quadraticCurveTo) the first point is specified by using the moveTo function.

Arguments to the function

An example

<script>
    window.onload = function ()
    {
        var canvas  = document.getElementById("cvs");
        var context = canvas.getContext('2d');

        context.beginPath();
        context.moveTo(100, 100);
        context.lineTo(200, 200);
        context.stroke();
    }
</script>