This is a migrated thread and some comments may be shown as answers.

DateTimeContinuousAxis - How to change MajorStepUnit form code

1 Answer 110 Views
Chart
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Lukasz
Top achievements
Rank 1
Lukasz asked on 11 Jul 2011, 02:25 PM
Hi,
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,
Lukasz

1 Answer, 1 is accepted

Sort by
0
Accepted
Georgi
Telerik team
answered on 11 Jul 2011, 02:44 PM
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,
Georgi
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!

Tags
Chart
Asked by
Lukasz
Top achievements
Rank 1
Answers by
Georgi
Telerik team
Share this question
or