This is a migrated thread and some comments may be shown as answers.

MVVM Chart Label Template...

2 Answers 88 Views
MVVM
This is a migrated thread and some comments may be shown as answers.
Robin
Top achievements
Rank 1
Robin asked on 31 Jul 2013, 07:20 PM
I am trying to build a chart using kendo mvvm but can't seem to figure out how to template the labels on the chart (category axis, value axis, and series labels).

This is ideally what I would like the chart to look like
http://jsbin.com/uvarit/4/edit

And can get the chart to render
http://jsbin.com/obojiz/2/edit

I just can't figure out how to add the label templates in. Needing to delimit a string within a string within a string, some sort of Stringception or something.

Thanks.

2 Answers, 1 is accepted

Sort by
0
Iliana Dyankova
Telerik team
answered on 02 Aug 2013, 08:52 AM
Hello Robin,

In order to achieve this you should define the template in the labels object, however you should escape the quotes:
<div id="chartTotals"
  //....
   data-category-axis="{field: 'Date', labels: { visible: true, rotation: '45', template: '#=kendo.toString(value, \'MM/dd/yyyy\')#' }}"
  //....
>
For your convenience I updated the jsBin example

Regards,
Iliana Nikolova
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Robin
Top achievements
Rank 1
answered on 02 Aug 2013, 01:17 PM
Thank you for the reply, this works great.
Tags
MVVM
Asked by
Robin
Top achievements
Rank 1
Answers by
Iliana Dyankova
Telerik team
Robin
Top achievements
Rank 1
Share this question
or