javascript - How to call a function in kendo -
i format mt x axis label via calling method follows:
xaxis: { labels: { template: "#= shortlabels(value) #" }, } function shortlabels(value) { var strvalue = kendo.tostring(value) strvalue = strvalue + ""; strvalue = strvalue.substring(1) return strvalue; } however getting
shortlabels not defined error
basically not call method.
you can set function in kendo-template. isn't beauty, know, works:
<script id="labeltemplate" type="text/x-kendo-template"> # var strvalue = kendo.tostring(value) strvalue = strvalue + ""; strvalue = strvalue.substring(1); # #= strvalue # </script> and in chart property:
labels: { template: kendo.template($("#labeltemplate").html()) }
Comments
Post a Comment