Home forums Using CanvasJS Drawing with canvasjs?

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #14211

    Hello,

    From my investigating, it seems very clear to me that CanvasJS is built upon the regular HTML5 canvas framework. As there are some things CanvasJS doesn’t do that I would like to be able to do, I thought that maybe I could do regular canvas drawing/rendering on top of CanvasJS charts.

    Could someone tell me the correct syntax to do this? For example, I’ve tried this…

    //renders the outer donut
            var finalOuterChart = new CanvasJS.Chart(containers[0], outerDoughnutChart);
            finalOuterChart.render();
            var canvas = finalOuterChart.ctx.canvas;
            var context = canvas.getContext("2d");
            context.moveTo(50, 50);
            context.lineTo(62, 62);
            context.stroke();

    That doesn’t seem to do anything though. I’m just trying to draw a simple line for starters. I’ve tried several other methods, but have thus far been unsuccessful. A little help please?

    Thanks,
    Scott

    #14221

    @cshickman,

    You can create an additional canvas and place it top of our rendering canvas. Please take a look at this jsFiddle.

    —-
    Bivek Singh

    #14227

    Thank you sir!

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.