This question is locked. New answers and comments are not allowed.
I have a RadChart on my page. Here is the XAML.
After page initialization I want to check the data and change the majorstep value so that the data is formatted in the appropriate way.
Here is my code to do that:
If you back out of the page and reopen it with the same data, then yes, it shows the correct major step, but I would like it to show the correct data immediately. I am sure this is a very minor thing to fix, but please help.
<telerikChart:RadCartesianChart x:Name="myChart" > <telerikChart:RadCartesianChart.HorizontalAxis> <telerikChart:CategoricalAxis GapLength="0.5" LabelInterval="1" LabelOffset="1" PlotMode="OnTicks" TickThickness="8" ZIndex="1"/> </telerikChart:RadCartesianChart.HorizontalAxis> <telerikChart:RadCartesianChart.VerticalAxis> <telerikChart:LinearAxis LineThickness="2" /> </telerikChart:RadCartesianChart.VerticalAxis> <telerikChart:RadCartesianChart.Grid> <telerikChart:CartesianChartGrid MajorLinesVisibility="X" MajorXLinesRenderMode="All"/> </telerikChart:RadCartesianChart.Grid> <telerikChart:AreaSeries CategoryBinding="Header" ValueBinding="Time" ItemsSource="{Binding TimeReportChartData}" Stroke="{StaticResource AppAccentBrush}" Fill="{StaticResource AppForegroundBrush}" ClipToPlotArea="False"> </telerikChart:AreaSeries></telerikChart:RadCartesianChart>After page initialization I want to check the data and change the majorstep value so that the data is formatted in the appropriate way.
Here is my code to do that:
if (App.ViewModel.icReport.Count > 1) { var axis = myChart.VerticalAxis as LinearAxis; if (axis != null) axis.MajorStep = 10;} else { var axis = myChart.VerticalAxis as LinearAxis; if (axis != null) axis.MajorStep = 2;}If you back out of the page and reopen it with the same data, then yes, it shows the correct major step, but I would like it to show the correct data immediately. I am sure this is a very minor thing to fix, but please help.