Hi,
Is it possible to add text/label to the centre of the igDoughnutChart? Like the number 13 below:
Thanks,
Euan.
We can alsp do this using DIV by getting the centerCoordinate and putting the div in center of innerExtent
Hello Euan,
This behavior is not supported by our tools unfortunately. But there are ways in which you can achieve this. Since the igDoughnutChart is drawn utilizing the canvas element, you can get the canvas element utilizing jQuery’s get method. Here’s a link to jQuery’s documentation: https://api.jquery.com/jquery.get/ Note that there are other ways to get the element; this is just one of many options.
Afterwards, you can use the canvas element’s getContext() method to get the canvas’ drawing context. Now you would need to include the appropriate logic to draw onto the canvas. If your label is strictly text, here’s a link that can help you out: https://developer.mozilla.org/en-US/docs/Web/API/Canvas_API/Tutorial/Drawing_text
If you are not familiar with the canvas element, I recommend giving this a read: https://developer.mozilla.org/en-US/docs/Web/API/Canvas_API