Telerik RadHtmlChart Y Axis labels as seconds but showing time

2 posts, 0 answers
  1. Andrew
    Andrew avatar
    2 posts
    Member since:
    May 2016

    Posted 09 May Link to this post

    I have a line graph
    The Y axis are time in seconds.


    What I want is the legend for each point to be time not seconds


    lineSeries1.TooltipsAppearance.DataFormatString = "{0}";

    its just coming up with numbers though :(
    also is there any way of formatting the Y axis, so that instead of seconds I get
    5:00 10:00 15:00 20:00 25:00
    etc ? which relates to
    500 seconds 1000 seconds 1500 seconds 2000 seconds
    The data is fed in using a datatable in code behind so dont really want to hard code the times as they could be very variable.
    foreach (DataRow row in dt.Rows){CategorySeriesItem item1 = new CategorySeriesItem(); item1.Y = int.Parse(row["TimeInSeconds"].ToString()); lineSeries1.SeriesItems.Add(item1);}
    This draws the point, but what I want to be able to do is set the legends and labels for the time

  2. Marin Bratanov
    Marin Bratanov avatar
    3555 posts

    Posted 12 May Link to this post

    Hello Andrew,

    You can use the Y-axis labels template feature that is available as of R2 2016. With it, you can create a function that will turn the seconds into the desired string. If you are using an older version, see this item that provides a workaround:


    Marin Bratanov
    Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
  3. DevCraft R3 2016 release webinar banner
Back to Top