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

RadCartesianChart - flexibility on time axis control labels

2 Answers 52 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.
Mahender
Top achievements
Rank 1
Mahender asked on 11 Dec 2012, 03:41 PM

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 Answers, 1 is accepted

Sort by
0
Accepted
Victor
Telerik team
answered on 12 Dec 2012, 09:14 AM
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.
0
Mahender
Top achievements
Rank 1
answered on 13 Dec 2012, 09:49 PM
Thanks Victor for the answer.
Tags
Chart
Asked by
Mahender
Top achievements
Rank 1
Answers by
Victor
Telerik team
Mahender
Top achievements
Rank 1
Share this question
or