RadCartesianChart - flexibility on time axis control labels

3 posts, 1 answers
  1. Mahender
    Mahender avatar
    5 posts
    Member since:
    Apr 2012

    Posted 11 Dec 2012 Link to this post

    Hi,

     

    I am new to telerik controls, am developing a WP8 app with it. I am using Chart control to draw a chart against datetime axis.

     

    I am using below sample data to draw the chart (Areaseries type chart)

     

     

    12/10/2010 3:25:12 PM

    93

    12/10/2010 3:01:12 PM

    93

    12/10/2010 2:45:12 PM

    92

    12/10/2010 2:15:12 PM

    91

    12/10/2010 1:45:12 PM

    90

    12/10/2010 1:05:12 PM

    89

    12/10/2010 11:05:12 AM

    79

    12/09/2010 3:25:12 PM

    93

    12/09/2010 3:01:12 PM

    93

    12/09/2010 2:45:12 PM

    92

    12/09/2010 2:15:12 PM

    91

    12/09/2010 1:45:12 PM

    90

    12/09/2010 1:05:12 PM

    89

    12/09/2010 11:05:12 AM

    79

     

    When I start drawing chart with this data, X-Axis labels are cluttered with lots of these timestamp values. Is there any way to control these labels and show only 1hr or 4hrs increments instead of showing all individual time values?

     

    I am using below xaml defintion:

     

    <Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
                
    <telerikChart:RadCartesianChart  x:Name="radChart" Margin="0,0,19,51">
                    
    <telerikChart:RadCartesianChart.Grid>
                        
    <telerikChart:CartesianChartGrid MajorLinesVisibility="Y"/>
                    
    </telerikChart:RadCartesianChart.Grid>
                    
    <telerikChart:RadCartesianChart.HorizontalAxis >
                        
    <telerikChart:DateTimeContinuousAxis 
                       
     Minimum="7:00"
                       
     Maximum="21:00" 
                       
     LabelFormat="h:mm" LabelFitMode="MultiLine">
                            
    <telerikChart:DateTimeContinuousAxis.MajorTickStyle>
                                
    <Style TargetType="Rectangle">
                                    
    <Setter Property="Fill" Value="#666666"/>
                                    
    <Setter Property="Margin" Value="0, -3, 0, 0"/>
                                
    </Style>
                            
    </telerikChart:DateTimeContinuousAxis.MajorTickStyle>
                        
    </telerikChart:DateTimeContinuousAxis>
                    
    </telerikChart:RadCartesianChart.HorizontalAxis>
                    
    <telerikChart:RadCartesianChart.VerticalAxis>
                        
    <telerikChart:LinearAxis
                       
     LineStroke="Transparent"
                       
     Maximum="100">
                        
    </telerikChart:LinearAxis>
                    
    </telerikChart:RadCartesianChart.VerticalAxis>

                    <telerikChart:AreaSeries CombineMode="Stack" Fill="#88FF5B00">
                        
    <telerikCharting:CategoricalDataPoint Value="1.0"/>
                        
    <telerikCharting:CategoricalDataPoint Value="1.0"/>
                        
    <telerikCharting:CategoricalDataPoint Value="1.0"/>
                        
    <telerikCharting:CategoricalDataPoint Value="1.0"/>
                        
    <telerikCharting:CategoricalDataPoint Value="1.0"/>
                    
    </telerikChart:AreaSeries>
                
    </telerikChart:RadCartesianChart>

  2. Answer
    Victor
    Admin
    Victor avatar
    1351 posts

    Posted 12 Dec 2012 Link to this post

    Hi Mahender,

    Thanks for the question.
    Please use the LabelInterval property of your horizontal axis.

    Write again if you have other questions.

    Greetings,
    Victor
    the Telerik team
    Have a suggestion or face a problem - you can use the Ideas & Feedback portal to submit ideas, feedback and vote for them.
  3. DevCraft banner
  4. Mahender
    Mahender avatar
    5 posts
    Member since:
    Apr 2012

    Posted 13 Dec 2012 Link to this post

    Thanks Victor for the answer.
Back to Top