How to get the month names in kendo chart by using function

后端 未结 2 1576
半阙折子戏
半阙折子戏 2021-01-26 04:44

How to create a function to get the month as Jan,feb.. displayed in kendo chart x axis.

var internetUsers = [ {
                            \"Month\": \"1\",
           


        
2条回答
  •  轮回少年
    2021-01-26 05:06

    First add an array to hold the month names, like so:

    var monthNames = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug"];
    

    then modify the categoryAxis to use this array

    categoryAxis: {
        field: "Month",
        labels: {
            template: "#=monthNames[value - 1]#"
        },
    },
    

提交回复
热议问题