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

Cant get baseUnit: "month" to work, object error

1 Answer 28 Views
Charts
This is a migrated thread and some comments may be shown as answers.
Neil
Top achievements
Rank 1
Neil asked on 25 Feb 2013, 12:58 PM
Hi there, I got a kendo chart category axis described like this :

categoryAxis: {
            majorGridLines: "none",
            type: "date",
            field: "Day",
            baseUnit: "month",
            labels: {
                font: "6.25pt Verdana",
                rotation: -45,
                template: " #= new Date(parseInt(value.substr(6))).getDate() #" + "/" + "#= month[new Date(parseInt(value.substr(6))).getMonth()] #"
            },
            title: {
            }            
        }

I also got another Kendo chart with category axis liek this :

categoryAxis: {
            majorGridLines: "none",
            field: "Day",
            labels: {
                font: "6.25pt Verdana",
                rotation: -45,
                template: " #= new Date(parseInt(value.substr(6))).getDate() #" + "/" + "#= month[new Date(parseInt(value.substr(6))).getMonth()] #"
            },
            title: {
            }
        }


So in the second example everything works fine except I get a date for each point in the chart, so I wanted to make it show only every 1st of the month ( there are 6 months in total). So the first code snippet should do that but i get an error: "Uncaught TypeError: Object [object Date] has no method 'substr' ". I assume I should use some sort of ekndo.dateparse, but im not sure of the syntax of it. Could someone pelase help.
Note that the tooltip shows the date just fine.

Please find a screenshot attached,

Regards,
Neil




1 Answer, 1 is accepted

Sort by
0
Iliana Dyankova
Telerik team
answered on 27 Feb 2013, 12:31 PM
Hello Neil,

I am not quite sure if I understand you correctly. Could you please provide more detailed information about the exact functionality you are trying to implement or better yet send a simple jsFiddle / jsBin example which demonstrates your current implementation? This way I would be able to advice you further and provide concrete recommendations. Thank you in advance for your time.
 
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
Neil
Top achievements
Rank 1
Answers by
Iliana Dyankova
Telerik team
Share this question
or