Chart with month on the category axis

2 posts, 0 answers
  1. Pascal
    Pascal avatar
    10 posts
    Member since:
    Oct 2007

    Posted 20 Dec 2011 Link to this post

    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
  2. Pascal
    Pascal avatar
    10 posts
    Member since:
    Oct 2007

    Posted 20 Dec 2011 Link to this post

    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]#"
       }
    }
  3. Kendo UI is VS 2017 Ready
Back to Top