I am currently working on developing a tree-like structure. I have successfully created numbers within circles using HTML badges. However, I am facing difficulty in drawing lines connecting one element to another. I attempted using left and right diagonal images but that did not work as expected.
Below is the HTML code snippet for creating Badges:
<span id="0" class="cl w3-badge">0</span><br><br><br><br>
<span id="1" class="cl w3-badge">0</span>
<span id="2" class="cl w3-badge">0</span>
Here is my JavaScript snippet:
var data = [];
data.push(5);
data.push(6);
data.push(4);
$('.w3-badge').each(function(i, obj) {
document.getElementById(i).innerHTML = data[i];
});
You can find the image of the left line here
If anyone has any suggestions or solutions, please reach out to me. My goal is to achieve a final tree structure similar to this: Final Tree Image