add text to dojo chart (in this case scatter chart

2019-07-12 15:47发布

问题:

I want to add custom text to my (scatter) chart. I could netiher find an example nor any other appropriate dojo function for that.

By now I have a tooltip for each point of my scatter chart, but I'd rather like to have a label for it.

Any idea?

Thanks!

回答1:

You need to upgrade to dojo 1.9.7 at least to use this answer: First of all, You have to set a new option: "labelStyle: 'outside'". This position the text uppon the circle in case the label width is larger than than the circle. The next option to use is:

labelFunc: function(value){ return value.text; } This function tells the Chart which label to display. I updated the fiddle example: Updated JSFiddle