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

decode values displayed as series values on Chart

1 Answer 44 Views
Charts
This is a migrated thread and some comments may be shown as answers.
Alex VonBrand
Top achievements
Rank 1
Alex VonBrand asked on 14 May 2013, 08:32 PM
I have a column chart with series values of 0, 1,2,3,4.
Rather than display the numbers, I would like to decode the numbers to a string value, e.g.  instead of 1 as a label display something like 'low', instead of 2 display 'medium' etc.  I have tried to get this to work with templates but have been unsuccessful.

something like

    series: [{
                        type: "column",
                        aggregate: "avg",
                        field: 'value',
                        labels: {
                            template: "#if(value == 4) { # ${'exceed'} # } else { # ${value} #} #"
 
                    }
                    }],

 The chart ignores the template and just displays the numbers 1,2 etc.
Is it possible to do what I want to do.

1 Answer, 1 is accepted

Sort by
0
Iliana Dyankova
Telerik team
answered on 16 May 2013, 08:57 AM
Hi Alex,

You could achieve the desired result using template for the series.labels and execute custom logic in this template. For your convenience here is a simple jsBin example which demonstrates a possible implementation.
 
Regards,
Iliana Nikolova
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
Charts
Asked by
Alex VonBrand
Top achievements
Rank 1
Answers by
Iliana Dyankova
Telerik team
Share this question
or