Question

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"
        }
    },

enter image description here

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

Was it helpful?

Solution

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) #"
   }
},

OTHER TIPS

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top