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

3 posts, 0 answers
  1. Suk
    Suk avatar
    15 posts
    Member since:
    Mar 2015

    Posted 19 Mar 2015 Link to this post

    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. Suk
    Suk avatar
    15 posts
    Member since:
    Mar 2015

    Posted 20 Mar 2015 Link to this post

    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. 
  3. Suk
    Suk avatar
    15 posts
    Member since:
    Mar 2015

    Posted 21 Mar 2015 Link to this post

    Problem solved... I used `ToShortDateString()` in the controller... So, I am sending a string instead of dateTime...
Back to Top