X-Axis Step When Using Time

6 posts, 1 answers
  1. Ryan Overton
    Ryan Overton avatar
    12 posts
    Member since:
    Oct 2009

    Posted 07 Dec 2009 Link to this post

    I have been able to add a chart to my report and bind the data to the chart. I have even gotten the X-axis to display in time, but I have 2 design requirements which I cannot figure out.

        -    1. How do I provide a custom step when I am using the time value format? If I use autoscale, it does provide some stepping, but it puts a buffer before the beginning of the first time and another buffer at the end. If I change autoscale to false, I cannot enter a label step large enough to display as many as I want. 

        -    2. How can I display both date and time as the label on each step of the X-axis? I can do date or time, but have not found a way to do date and time together. The chart could span 1 - 3 days.

    Can anyone help me resolve either of these issues?
  2. Answer
    Ves avatar
    2926 posts

    Posted 09 Dec 2009 Link to this post

    Hi Ryan,

    With AutoScale set to false, you would need to manually configure the MinValue, MaxValue and Step properties. So, you can leave LabelStep property with its default value of 1 - the Step property will guarantee that you will see only certain labels. Note, that in the OLEAutomation date format (double) a value of 1 corresponds to 1 day (ex. a step of 3 hours would be 3d/24 or .125).

    Displaying date and time simultaneously -- set XAxis.Appearance.ValueFormat to one of the DateTime-related members (ex. ChartValueFormat.ShortDate) and then set XAxis.Appearance.CustomFormat property with any valid standard or custom DateTime format string.


    Kind regards,
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  3. Yanli
    Yanli avatar
    9 posts
    Member since:
    Sep 2012

    Posted 11 Sep 2013 Link to this post

    I need to set the X-Axis steps dynamically based on how many data points in the series. I'm using Graph since Chart is depreciated. Now with Graph, how can I access AutoScale, MinValue, MaxValue and Steps? it doesn't has the property PlotArea.

  4. Peter
    Peter avatar
    1668 posts

    Posted 13 Sep 2013 Link to this post

    Hi Yanli,

    You can access the properties of an Axis by selecting the Axis as shown here. You can also set these properties programmatically:
    var graph1 = new Telerik.Reporting.Graph();
    var cartesianCoordinateSystem = new Telerik.Reporting.CartesianCoordinateSystem();
    var scale = new Telerik.Reporting.DateTimeScale();
    //set needed properties
    scale.MajorStep = 1;
    scale.Minimum = 1;
    var graphAxisNumericScale = new Telerik.Reporting.GraphAxis();
    graphAxisNumericScale.Scale = scale;
    cartesianCoordinateSystem.XAxis = graphAxisNumericScale;
    For a more thorough and complete example on how to create a graph and add series and other elements programmatically, please follow the How to: Create Chart Programmatically help article.


    Have you tried the new visualization options in Telerik Reporting Q2 2013? You can get them from your account.

  5. Kedar
    Kedar avatar
    1 posts
    Member since:
    Apr 2015

    Posted 09 Apr 2015 in reply to Ves Link to this post


     I am using telerik RadCartesianChart and I would want to set the step along horizontal axis,I am unable to find any property associated with the chart to set to.

    Also I am unable to put colors to series(line series, I have as many as 5 line series in a chart). Could some one help me with this?



  6. Nasko
    Nasko avatar
    1077 posts

    Posted 09 Apr 2015 Link to this post

    Hello Kedar,

    Telerik Reporting uses Telerik.Reporting.Graph to create and render charts in the reports. For more information on the Graph item and how to use it, please refer to the Graph help articles in the Reporting online documentation.


    See What's Next in App Development. Register for TelerikNEXT.

Back to Top