You must be logged in to post your query.
Home › Forums › Chart Support › Drawing with canvasjs?
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
@cshickman,
You can create an additional canvas and place it top of our rendering canvas. Please take a look at this jsFiddle.
—- Bivek Singh
Thank you sir!
You must be logged in to reply to this topic. Login/Register