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

AxisX DefaultLabelFormat="#DATAITEM.Title"

1 Answer 50 Views
This is a migrated thread and some comments may be shown as answers.
Top achievements
Rank 1
Cole asked on 10 Nov 2011, 02:13 AM
A data entity has three values; Title, GoalTotal, ShipmentsTotal
I have a chart with two horizontal series.
I am trying unsucessfully to show the Title field as an AxisX Label using :

P.S.   The tool tips using the same format specification work fine...

(XAML Code follows)
<telerik:RadChart ItemsSource="{Binding Path=TheObservableCollection}">
        <telerik:ChartTitle Style="{StaticResource styleChartTitle}" Content="Program Goals vs. Shipments" HorizontalAlignment="Center"/>
        <telerik:ChartLegend Header="Legend" x:Name="chartLegend" />
      <telerik:ChartDefaultView.ChartArea  >
        <telerik:ChartArea LegendName="chartLegend" ItemOverlapPercent="70" SmartLabelsEnabled="True" >
            <telerik:AxisX DefaultLabelFormat="#DATAITEM.Title" >
                    <Style TargetType="TextBlock">
                      <Setter Property="TextAlignment" Value="Right" />
                      <Setter Property="Padding" Value="1" />
                      <Setter Property="Width" Value="200" />
                      <Setter Property="TextWrapping" Value="Wrap" />
  <telerik:RadChart.SeriesMappings  >
    <telerik:SeriesMapping LegendLabel="Program Goals">
        <telerik:HorizontalBarSeriesDefinition ShowItemToolTips="True" ItemToolTipFormat="#DATAITEM.Title" />
      <telerik:ItemMapping DataPointMember="YValue" FieldName="GoalTotal" />
    <telerik:SeriesMapping LegendLabel="Program Shipments">
        <telerik:HorizontalBarSeriesDefinition ShowItemToolTips="True" ItemToolTipFormat="#DATAITEM.Title" />
      <telerik:ItemMapping  DataPointMember="YValue" FieldName="ShipmentsTotal" />




1 Answer, 1 is accepted

Sort by
Telerik team
answered on 14 Nov 2011, 01:01 PM
Hello Cole,

Can you elaborate a bit more on what do you want to achieve? What is the purpose of the Title property - DataPoint.Label, DataPoint.LegendLabel or DataPoint.XCategory? Knowing this will help us to provide you with a more proper support based on your case.
Also have in mind that using the #DATAITEM token can't be used with formatting AxisX labels as it can bes used to format  Series Items Labels and Tooltips only. More information about it can be found in our help topic

All the best,
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
Asked by
Top achievements
Rank 1
Answers by
Telerik team
Share this question