Time formatted X-Axis

7 posts, 1 answers
  1. Libertad
    Libertad avatar
    53 posts
    Member since:
    Sep 2008

    Posted 31 May 2011 Link to this post

    hi,

    I'm reading a column from a Excel file including time data with hh:mm:ss format.
    I couldn't show them properly using RadChart in X-Axis. I've used the following code:

    radChart.DefaultView.ChartArea.AxisX.IsDateTime = true;
    radChart.DefaultView.ChartArea.AxisX.Step = 5;
    radChart.DefaultView.ChartArea.AxisX.LabelStep = 2;
    radChart.DefaultView.ChartArea.AxisX.StepLabelLevelCount = 3;
    radChart.DefaultView.ChartArea.AxisX.StepLabelLevelHeight = 10;
    radChart.DefaultView.ChartArea.AxisX.DefaultLabelFormat = "hh:mm:ss";

    in X-Axis it only shows 00:00 !?
    What's the solution?
  2. Giuseppe
    Admin
    Giuseppe avatar
    2363 posts

    Posted 06 Jun 2011 Link to this post

    Hi Libertad,

    Please excuse us for the delay.

    Regarding your issue, the X axis makes all the needed range calculations and when there is data for the past several days it displays the steps as one day, therefore each tick is 00:00.

    You can use the following options.
    1. Use Categories. See the link below for more information:
    http://www.telerik.com/help/silverlight/radchart-features-categorical-charts.html
    2. You could also set the AxisX.AutoRange to false and pass only min, max and step parameters(i.e. AxisX.AddRange(min, max, step)).

    You can also find useful information about DateTime Support here:
    http://www.telerik.com/help/silverlight/radchart-features-datetime-support.html

    If you need any further help, please do not hesitate to ask.
     

    Greetings,
    Petar Horozov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. UI for WPF is Visual Studio 2017 Ready
  4. Libertad
    Libertad avatar
    53 posts
    Member since:
    Sep 2008

    Posted 07 Jun 2011 Link to this post

    Dear Petar
    Thanks for your reply.
    I even applied AddRange method in my code but I still have problem with time formatting.
    How can I attache my sample here?
    Thank you in advance.
  5. Peshito
    Admin
    Peshito avatar
    497 posts

    Posted 10 Jun 2011 Link to this post

    Hello Libertad,

    I attached a sample project that should be similar to yours. Please take a look at it and you may find it helpful.

    You can also refer to the following topics below.
    http://www.telerik.com/help/wpf/radchart-features-datetime-support.html
    http://www.telerik.com/help/wpf/radchart-getting-started-create-data-bound-chart.html

    For security reasons zip attachments are not allowed in the public forums but you can open a formal support ticket and send us your sample application should you have further questions.


    Greetings,
    Peshito
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  6. Libertad
    Libertad avatar
    53 posts
    Member since:
    Sep 2008

    Posted 10 Jun 2011 Link to this post

    Hi,
    Due to dynamic issue I have to configure my chart in code behind not xaml.
    I wonder if you do some changes in my sample to solve the problem instead of creating new sample from scratch.
    Thanks.
  7. Libertad
    Libertad avatar
    53 posts
    Member since:
    Sep 2008

    Posted 14 Jun 2011 Link to this post

    No answer?
  8. Answer
    Peshito
    Admin
    Peshito avatar
    497 posts

    Posted 15 Jun 2011 Link to this post

    Hi Libertad,

    I suggest that we keep the conversation in a single thread so that it is easier for both sides to follow it.

    I edited the project you've attached in the other thread started by you and attached it to this one.

    The reason why your values are displayed as 00:00 is because you've made new SeriesMapping instance in your for loop. At the end of the for loop, I simply added the following code:
    seriesMapping.ItemMappings.Add(itemMappingX);


    Regards,
    Peshito
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Back to Top
UI for WPF is Visual Studio 2017 Ready