template formatting and y-axis out of place

3 posts, 1 answers
  1. Chris
    Chris avatar
    16 posts
    Member since:
    Dec 2015

    Posted 16 Dec 2015 Link to this post

    Attached is an image showing my two issues, including the questions I have. For more detail, keep reading.

     

    For the tooltip, here is the code I use to generate it.

    .Tooltip(tt => tt.Visible(true).Template("#= value.x # - #= value.y #"))
                                    .XField("Time")
                                    .YField("Value");

    The Time field is your standard C# DateTime. I combed through the documentation but I couldn't find a way to format that date tool tip to be a readable date and time rather than the Unix Time Stamp. Is there a way to do that?

    For the top right chart, I'm just curious if there's a way to for the x-axis labels to always be displayed below the chart body? Here is the code used to generate the charts

    @(Html.Kendo().Chart()
                                .Name(string.Format("server-side-chart-{0}-{1}", i + 1, ii + 1))
                                .Title(string.Format("Plot {0},{1}", i, ii))
                                .Series(s =>
                                {
                                    s.ScatterLine(Model.DataGrid[i, ii].Data)
                                    .Name("Data")
                                    .Markers(false)
                                    .VisibleInLegend(false)
                                    .Tooltip(tt => tt.Visible(true).Template("#= value.x # - #= value.y #"))
                                    .XField("Time")
                                    .YField("Value");
                                })
                                .XAxis(x => x.Date().BaseUnit(ChartAxisBaseUnit.Seconds))
                        )

    Thanks.

  2. Chris
    Chris avatar
    16 posts
    Member since:
    Dec 2015

    Posted 16 Dec 2015 in reply to Chris Link to this post

    Follow up question:

    Are "Zoomable" and "Pannable" still supported with the Kendo.Chart? I see Documentation for it here (http://docs.telerik.com/kendo-ui/api/aspnet-mvc/Kendo.Mvc.UI.Fluent/ChartBuilder) but when I try to apply it to my chart I provided above I get compiler errors.

    Thanks

  3. Kendo UI is VS 2017 Ready
  4. Answer
    Iliana Nikolova
    Admin
    Iliana Nikolova avatar
    2592 posts

    Posted 18 Dec 2015 Link to this post

    Hi Chris,

    Up to the questions
    - ...The Time field is your standard C# DateTime....Is there a way to do that?
    For this requirement you could use kendo.format or kendo.toString in the template:

    //....
    .Tooltip(tt => tt.Visible(true).Template("#= kendo.format('{0:dd/MM/yyyy}', value.x ) # - #= value.y #"))

    - ...if there's a way to for the x-axis labels to always be displayed below the chart body?....
    For this one you should specify yAxis.AxisCrossingValue. As an example: 
    //....
    .YAxis(y => y
       .Numeric()
       .AxisCrossingValue(-50000)
    )

    - Are "Zoomable" and "Pannable" still supported with the Kendo.Chart? 
    This features were introduced in Kendo UI Q3 2015 release (v2015.3.1111) and will not work in previous versions. Could you please make sure you are using v2015.3.1111 (as pointed in the ticket info).

    Regards,
    Iliana Nikolova
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
Back to Top