DateTimeContinuousAxis, show another label instead x value

2 posts, 0 answers
  1. malabareand
    malabareand avatar
    2 posts
    Member since:
    Mar 2012

    Posted 14 Oct 2014 Link to this post

    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
     
  2. Ves
    Admin
    Ves avatar
    2879 posts

    Posted 17 Oct 2014 Link to this post

    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.

     
Back to Top