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

Need help on Bar Chart Auto Binding

1 Answer 40 Views
Chart
This is a migrated thread and some comments may be shown as answers.
cindy
Top achievements
Rank 1
cindy asked on 24 Sep 2010, 07:50 AM
Hi,

I'm using MVVM auto binding to create a Bar Chart

in my xaml,

 

<telerikChart:RadChart Width="200" Height="200" ItemsSource="{Binding DisplayedCapacitySeries}" Padding="3">
.... 
 <telerik:SeriesMapping.ItemMappings>  
    <telerik:ItemMapping DataPointMember="YValue" FieldName="Capacity_TB"/>   
     <telerik:ItemMapping DataPointMember="XCategory" FieldName="CapacityName" />   
 </telerik:SeriesMapping.ItemMappings>


The chart was created at the first loading. However, the Chart is not refreshed when Caparity_TB is changed although INotifyPropertyChanged is implemented in the ViewModel class. 

Also I want to show the legend with the CapacityName. I'm using LegendDisplayMode="DataPointLabel". However, the legend shows as "item 0 .. item 1" instead of the CapacityName on the XCategory.

Also how can I hide the legend header?
 

 


Thanks,

1 Answer, 1 is accepted

Sort by
0
Ves
Telerik team
answered on 29 Sep 2010, 09:58 AM
Hello cindy,

Please, find attached a small example, showing this scenario. For the legend items, you need to add another ItemMapping where with DataPointMember=LegendLabel. Finally, setting the ChartLegend.Header to string.empty will make it disappear.

Best regards,
Ves
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
Tags
Chart
Asked by
cindy
Top achievements
Rank 1
Answers by
Ves
Telerik team
Share this question
or