Home Forums Chart Support Adding images on Doughnut Reply To: Adding images on Doughnut

#40067

@john-black,

You can position images in the middle of the doughnut chart by adding a few lines of code. Please check out the code snippet below for the same,

img.style.position = "absolute";
img.style.display = "block";
img.style.top =  chart.height/2 - img.offsetHeight/2 + "px";
img.style.left = chart.width/2 - img.offsetWidth/2.3 + "px";

Also, please take a look at this JSFiddle for a complete code. For further insight, please refer to this step-by-step guide for positioning images over chart.

doughnut chart with image in the middle


Adithya Menon
Team CanvasJS