X-Axis label values not populating

3 posts, 0 answers
  1. Josh
    Josh avatar
    2 posts
    Member since:
    Jan 2013

    Posted 24 Jan 2013 Link to this post

    Hello, I'm creating a bar chart. My AxisY is a integer count and my AxisX is a string for a build number.

    My ItemSource is pointing to an

    ObservableCollection<Tuple<string, int>>

    If I have 30 build buckets, when viewing my chart the buckets for my AxisX are numbered 1-30, instead of the string buildnumber. How can I get my buildnumber to show up as the tick name instead of this 1-30?

    Thanks, Josh

    Image Example
    <telerik:RadChart x:Name="radChart" ItemsSource="{Binding DataPoints}"
                              Visibility="{Binding ServiceState,
                              Converter={StaticResource EnumToVisibilityConverter},
                                    <telerik:AxisX  IsDateTime="False"
                                    <telerik:AxisY Title="Unique Crashes"
                                                   Visibility="Visible" />
  2. Josh
    Josh avatar
    2 posts
    Member since:
    Jan 2013

    Posted 24 Jan 2013 Link to this post

    After doing some forum searching, I found my answer here.


  3. UI for WPF is Visual Studio 2017 Ready
  4. Petar Kirov
    Petar Kirov avatar
    425 posts

    Posted 29 Jan 2013 Link to this post

    Hi Josh,

    The approach demonstrated on the link is outdated (from 2009). A better way to achieve this is to use the ItemMappings collection of the SeriesMapping to specify an XCategory binding. For example: 
    <telerik:RadChart ItemsSource="{Binding DataPoints}">
            <telerik:ItemMapping DataPointMember="XCategory" FieldName="Item1"/>
            <telerik:ItemMapping DataPointMember="YValue" FieldName="Item2"/>
    (Item1 and Item2 are properties of string and int properties of the Tuple respectively.)

     Here you read more about this.

    All the best,
    Petar Kirov
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Back to Top