Hello heerak2492!
We appreciate you reaching out to us!
You can add some styling to dataLabels by setting dataLabels.useHTML to true and wrapping them with div with proper CSS styles. Please, check the demo below.
Hi Hubert, Thank you so much for the styling. That was really helpful. Need one more information regarding the labels. Right now, I have been rendering the labels without any weight attached to the label. Like this:
without.png (20.33 KiB) Viewed 374 times
. Is there a possibility to render the chart with the weights or any values to be attached to the respective label strings like this:
heerak2492,
You can show any value from this object in nodeFormatter callback function. For example, you can pass a sum of points of each label. You can check it in the demo below.
Hey Hubert, Thanks for a quick reply. I need to get the weight along with the key. But like we are showing for key by this.key, is it not possible to show weight by this.weight or ayything like that?
the weight property is attached to each point and it is related also to each path between two points. From the 'Brazil' node, there are 4 paths (one with a different weight, three with the same weight), so there cannot be just one number of weight in the data label. That's why I suggested using this.sum, which is a sum of weight from each node. In console.log from 12 line you can see what properties you can show in the data label.