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

Chart data field starts with a number

1 Answer 72 Views
Charts
This is a migrated thread and some comments may be shown as answers.
Joey
Top achievements
Rank 1
Joey asked on 24 Nov 2015, 04:35 PM

Using a data field that starts with a number prevents the chart from rendering. Numbers can be used within the field but apparently not at the very beginning.

Is there a workaround for this?

This is an example:

 var stats = [

                    { 1result1: 30, result2: 20, date: new Date("2011/12/20") },
                    { 1result1: 50, result2: 20, date: new Date("2011/12/21") },
                    { 1result1: 30, result2: 20, date: new Date("2012/01/05") }
                ];

Change 1result1 to result1 and everything works fine.

http://dojo.telerik.com/aMIjE

 

1 Answer, 1 is accepted

Sort by
0
Accepted
Patrick | Technical Support Engineer, Senior
Telerik team
answered on 24 Nov 2015, 05:34 PM
Hi Joey,

Conventionally, you should not put numbers in the beginning of your property names.  Take a look at this documentation on JavaScript Objects from MDN.  

Regards,
Patrick
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
Charts
Asked by
Joey
Top achievements
Rank 1
Answers by
Patrick | Technical Support Engineer, Senior
Telerik team
Share this question
or