ChartLegend.DisplayMemberPath has not effect

2 posts, 1 answers
  1. Anton Swanevelder
    Anton Swanevelder avatar
    28 posts
    Member since:
    Aug 2008

    Posted 01 Jun 2011 Link to this post


    I am following your example code to bind data to a Chart. I am able to see the data but not any labels. Labels only display as Item 1, Item 2 etc. even though I specify a DisplayMemberPath on the ChartLegend.

    <telerik:RadChart d:LayoutOverrides="Width, Height" ItemsSource="{Binding ActivitySummaryModel}" MaxHeight="610">
                            <telerik:PieSeriesDefinition />
                                    <telerik:ChartLegend x:Name="chartLegend" DisplayMemberPath="Category" Header="Category" />
                                    <telerik:ChartArea LegendName="chartLegend" DisplayMemberPath="Count" >
                                            <telerik:CameraExtension />

    Any help will be appreciated.

  2. Answer
    Ves avatar
    2869 posts

    Posted 03 Jun 2011 Link to this post

    Hello Anton,

    Indeed, there is a property DisplayMemberPath in ChartLegend as it inherits from HeaderedItemsControl. This property is not used, however. The reason for this decision is in the number of scenarios supported by RadChart e.g.  several DataSeries, where the legend should include items for each series, but not for each DataPoint.

    In order to populate the legend with values from your datasource, you will need to specify a SeriesMapping and a dedicated ItemMapping. You can find these explained in details in this help topic. You can also check this online example, there is a pie chart configured to show the country name in the legend.

    Best regards,
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. DevCraft R3 2016 release webinar banner
Back to Top