admin管理员组

文章数量:1418637

How do I format data being shown on a kendo ui bar chart?

I need some money values to be shown for example as "£5k" rather than "£5000".

        valueAxis: {
        labels: {
            format: "£{0}K"
        },
        title: {
            text: "Cover note premium"
        }
    },

I don't know how to divide the value being put into this graph.

How do I format data being shown on a kendo ui bar chart?

I need some money values to be shown for example as "£5k" rather than "£5000".

        valueAxis: {
        labels: {
            format: "£{0}K"
        },
        title: {
            text: "Cover note premium"
        }
    },

I don't know how to divide the value being put into this graph.

Share Improve this question edited Jul 27, 2020 at 14:17 sonyisda1 4341 gold badge10 silver badges22 bronze badges asked Jul 4, 2013 at 13:37 BobbyBobby 2,9383 gold badges22 silver badges37 bronze badges
Add a ment  | 

2 Answers 2

Reset to default 4

Finally found out how to divide a number on a label.

xAxis: {
   min: 8,
   max: 18,
   title: {
      text: "Hour of day"
   },
   labels: {
      template: "#= kendo.format('{0}',value/60) #"
   }
},

You can try this

valueAxis: {
    labels: {
        format: "£"+("{0}"/1000)+"K"
    },
    title: {
        text: "Cover note premium"
    }

but you should do this manipulation somewhere else, not inline.

本文标签: javascriptKendo chart formatting a axisStack Overflow