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

ChartLegend.DisplayMemberPath has not effect

1 Answer 55 Views
This is a migrated thread and some comments may be shown as answers.
Anton Swanevelder
Top achievements
Rank 2
Anton Swanevelder asked on 01 Jun 2011, 04:54 PM

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.


1 Answer, 1 is accepted

Sort by
Telerik team
answered on 03 Jun 2011, 07:47 AM
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
Asked by
Anton Swanevelder
Top achievements
Rank 2
Answers by
Telerik team
Share this question