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

DateTimeContinuousAxis, show another label instead x value

1 Answer 29 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.
malabareand
Top achievements
Rank 1
malabareand asked on 14 Oct 2014, 07:50 PM
Hello everyone!  

Im drawing a chart with RadCartesianCharts, and i have to display another value (age) instead custom x value datetime 

the structure for each point series is:

1.HeightPerson
2.{
3.   DateTime DateMeasure,
4.   decimal    Height,
5.   decimal    Age
6.}


and i'm using the following  horizontalAxis configuration:

1.<telerik:RadCartesianChart.HorizontalAxis>
2.  <chartView:DateTimeContinuousAxis LabelFitMode="Rotate"
3.         LabelFormat="{Binding AxisXformat}"
4.         Visibility="{Binding VisibilityAxis}"
5.         Title="{Binding TitleX}" />
6.</telerik:RadCartesianChart.HorizontalAxis>

 and the code where i'm making series

1.var edadSeries = new LineSeries(){
2.    ItemsSource = vm.PersonAge,
3.    Visibility = System.Windows.Visibility.Visible,
           //here is where i'm binding the date, but i would like to bind the "Age" property
4.    CategoryBinding = new PropertyNameDataPointBinding() { PropertyName = "DateMeasure" },
5.    ValueBinding = new PropertyNameDataPointBinding() { PropertyName = "Height" },
6.    BorderBrush = System.Windows.Media.Brushes.Black,
7.    BorderThickness = new Thickness(1),
8.    };

regards
 

1 Answer, 1 is accepted

Sort by
0
Ves
Telerik team
answered on 17 Oct 2014, 10:05 AM
Hi Carlos,

You will need a CategoricalAxis instead of DateTimeContinuousAxis. Then just set CategoryBinding for the LineSeries this way:

CategoryBinding = new PropertyNameDataPointBinding() { PropertyName = "Age" }

Best regards,
Ves
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
Chart
Asked by
malabareand
Top achievements
Rank 1
Answers by
Ves
Telerik team
Share this question
or