Home Forums Chart Support Adding images on Doughnut

Adding images on Doughnut

Viewing 3 posts - 1 through 3 (of 3 total)
  • #40052

    Hi Team,

    is it possible to add an image on doughnut like this





    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


    Thank you for sharing Adithya, how about adding an image on the label or in the circle pie, is it also possible to do that?

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

You must be logged in to reply to this topic.