This is a migrated thread and some comments may be shown as answers.
Chart with month on the category axis
1 Answer 98 Views
This is a migrated thread and some comments may be shown as answers.
Pascal
Top achievements
Rank 1
Pascal asked on 20 Dec 2011, 09:39 PM
Hi,
I am building a chart that has months on the category axis. I am currently passing intergers from 1 to 12 to represent the months. Is it possible to "convert" these values to month names using the kendo globalization api, so that the chart will know that numbers represent month and display the label accordingly?
Thank you,
Pascal.

[EDIT]
I think I am on the road, but it does not works yet. I tried this:

categoryAxis: {
   field: 'Mois',
   labels: {
      template: "#=kendo.cultures.current.calendar.months.namesAbbr[value-1]"
   }
}


it gives me an error : 
Invalid template:'#=kendo.cultures.current.calendar.months.namesAbbr[value-1]' Generated code:'var o,e=kendo.htmlEncode;with(data){o=''+(kendo.cultures.current.calendar.months.namesAbbr[value-1])+;}return o;'
Fichier Source : http://localhost:8080/Scripts/kendoui/kendo.all.min.js
Ligne : 11

1 Answer, 1 is accepted

Sort by
0
Pascal
Top achievements
Rank 1
answered on 20 Dec 2011, 09:57 PM
Ok I got it, I just missed a '#' at the end of my template:

categoryAxis: {
   field: 'Mois',
   labels: {
      template: "#=kendo.cultures.current.calendar.months.namesAbbr[value-1]#"
   }
}
Asked by
Pascal
Top achievements
Rank 1
Answers by
Pascal
Top achievements
Rank 1
Share this question
or