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

Kendo line chart date value shows /Date(1425148200000)/

2 Answers 11 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Suk
Top achievements
Rank 1
Suk asked on 19 Mar 2015, 12:02 PM
I have a kendo gri and kendo line chart.... Chart is based on the grid values...
The grid shows data as 

Now, I wish this date to be my X- asix...So, I coded as
 .CategoryAxis(axis => axis
                    //.Date()
                    .Categories(model => model.Price.EffectiveDate)
                    .Labels(labels => labels.Rotation(-90).Format("MMM/dd/yyyy"))
                )

But, my chart shows dates in a weird format...

Please help.. Thanx in advance...

2 Answers, 1 is accepted

Sort by
0
Suk
Top achievements
Rank 1
answered on 20 Mar 2015, 11:16 AM
My x-axis is showing dates as /Date(1425148200000)/. So, later I used 
.CategoryAxis(axis => axis
                    .Categories(model => model.Price.EffectiveDate)
                    .Labels(labels => labels.Rotation(-90).Template("#=dateFuntion(Price.MedispanEffectiveDate)#")))
And in script part as
function dateFuntion(date) {
    var date = new Date(parseInt(date.substr(6)));
       return date;
    }
But, still no progress. 
0
Suk
Top achievements
Rank 1
answered on 21 Mar 2015, 07:17 AM
Problem solved... I used `ToShortDateString()` in the controller... So, I am sending a string instead of dateTime...
Tags
General Discussions
Asked by
Suk
Top achievements
Rank 1
Answers by
Suk
Top achievements
Rank 1
Share this question
or