0

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.

Sample chart

Any help appreciated.

Shameem
  • 14,199
  • 13
  • 40
  • 43

3 Answers3

1

just add this in yoour series config

 label: {
                display: 'outside', 
                field: 'score',
                orientation: 'horizontal', // 'vertical'
                text-anchor': 'middle'
            }
Nag
  • 1,438
  • 1
  • 11
  • 39
  • Thanks, it works. Just needed to change `field` to `['unit1', 'unit2']` to have this displayed on second bar in the group. – Shameem Mar 08 '12 at 06:04
0

Label config is not work for me.

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

andr
  • 15,970
  • 10
  • 45
  • 59
Deepak Borade
  • 191
  • 2
  • 5
  • 15
0

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.

Neil Myatt
  • 597
  • 5
  • 9