DateTimeContinuousAxis - How to change MajorStepUnit form code

Thread is closed for posting
2 posts, 1 answers
  1. Lukasz
    Lukasz avatar
    9 posts
    Member since:
    Jun 2011

    Posted 11 Jul 2011 Link to this post

    I want to make few buttons to load data like - Day , Week, Month, Year and for this buttons a need to change some chart settings like:
    LabelFormat, LabelInterval, MajorStep, MajorStepUnit.
    For now I know how to change LabelFormat and LabelInterval, very easy way:

    chart.XAxis.LabelFormat = "yyyy-mm-dd";
    chart.XAxis.LabelInterval = "2"

    But how can I change MajorStepUnit and MajorStep?

    Best regards,
  2. Answer
    Georgi avatar
    296 posts

    Posted 11 Jul 2011 Link to this post

    Hello Lukasz,

    Thank you for your interest in RadChart for Windows Phone 7.

    Due to this limitation of the XAML parser, you cannot access an Axis instance through naming it in XAML. Instead you may cast the XAxis property of RadChart to DateTimeContinuousAxis and access its specific properties:

    DateTimeContinuousAxis dateTimeAxis = this.radChart1.XAxis as DateTimeContinuousAxis;
    dateTimeAxis.MajorStep = 3;
    dateTimeAxis.MajorStepUnit = TimeInterval.Day;

    I hope this information is useful. Let me know if you experience other issues.

    All the best,
    the Telerik team

    Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

Back to Top