add text to dojo chart (in this case scatter chart)

爱⌒轻易说出口 提交于 2019-12-11 03:06:54

问题


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



来源:https://stackoverflow.com/questions/9134038/add-text-to-dojo-chart-in-this-case-scatter-chart

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!