Sencha Touch chart - How to add label/value in column chart

时光怂恿深爱的人放手 提交于 2019-12-25 06:12:42

问题


I am using Sencha Touch charts 1.0.0 for my project. I would like to add values on each bar in the column chart. Is is possible to do ?

For example, see the image: I would like to add the values for each bar.

Any help appreciated.


回答1:


just add this in yoour series config

 label: {
                display: 'outside', 
                field: 'score',
                orientation: 'horizontal', // 'vertical'
                text-anchor': 'middle'
            }



回答2:


Label config is not work for me.

I used labelField:'comedy' in series it work.




回答3:


Came across this problem and found this solution didn't work. I'm using Touch Charts 2.0

This does work:

labelField: 'MyDataValue'

However, this does not work:

label: {
    display: 'outside', 
    field: 'score',
    orientation: 'horizontal', // 'vertical'
    text-anchor': 'middle'
}

According to Sencha 2.2.1 docs (latest at time of writing), the default for label config is:

label: {
    textBaseline: 'middle',
    textAlign: 'center',
    font: '14px Helvetica'
}

This suggests slightly different formatting params to those suggested by Nag. Maybe this is a change since v 1.x or it may to do with differences between Touch and ExtJS Anyway - hope it helps someone.



来源:https://stackoverflow.com/questions/9612725/sencha-touch-chart-how-to-add-label-value-in-column-chart

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