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

我是研究僧i 提交于 2019-12-02 11:20:22

You could use kendoui's time format function:

kendo.toString(new Date(2000, value, 1), "MMMM"); // if value = 9, it would output September

Check out kendoui's date format page. It is VERY helpful. http://docs.telerik.com/kendo-ui/getting-started/framework/globalization/dateformatting

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