Hi ,
I have a RADChart that is bound to a collection through a ViewModel and I wanted to capture the details when the user clicks on a bar within the chart.
I can do this in the code behind as below using the DataPoint.XCategory property of the click event but I need to pass the same as a parameter to a MVVMLight RelayCommand in the ViewModel in order to fire off another load event.
How do I do this?
Thanks
Phil
I have a RADChart that is bound to a collection through a ViewModel and I wanted to capture the details when the user clicks on a bar within the chart.
I can do this in the code behind as below using the DataPoint.XCategory property of the click event but I need to pass the same as a parameter to a MVVMLight RelayCommand in the ViewModel in order to fire off another load event.
AddHandler Chart.DefaultView.ChartArea.ItemClick, Sub(s, e) stopMe(s, e)
Private Function stopMe(ByVal sender As Object, ByVal e As Telerik.Windows.Controls.Charting.ChartItemClickEventArgs) As Object Dim sss As String sss = e.DataPoint.XCategory Stop End Function
<telerik:RadChart x:Name="Chart" Grid.Row="1" ItemsSource="{Binding Path=ConcernsCounts}"> <telerik:RadChart.SeriesMappings> <telerik:SeriesMapping> <telerik:SeriesMapping.SeriesDefinition> <telerik:BarSeriesDefinition ShowItemToolTips="True" /> </telerik:SeriesMapping.SeriesDefinition> <telerik:ItemMapping FieldName="ConcernsCount" DataPointMember="LegendLabel"/> <telerik:ItemMapping FieldName="BusinessUnit" DataPointMember="XCategory"/> <telerik:ItemMapping FieldName="ConcernsCount" DataPointMember="Label"/> <telerik:ItemMapping FieldName="ConcernsCount" DataPointMember="YValue"/> </telerik:SeriesMapping> </telerik:RadChart.SeriesMappings> <telerik:RadChart.DefaultView> <telerik:ChartDefaultView> <telerik:ChartDefaultView.ChartTitle> <telerik:ChartTitle Content="PLM Concerns By Business Unit" HorizontalAlignment="Center"/> </telerik:ChartDefaultView.ChartTitle> <telerik:ChartDefaultView.ChartLegend> <telerik:ChartLegend x:Name="ChartLegend" UseAutoGeneratedItems="True" Visibility="Collapsed"/> </telerik:ChartDefaultView.ChartLegend> <telerik:ChartDefaultView.ChartArea> <telerik:ChartArea LegendName="ChartLegend" Name="BusinessChartArea"> <telerik:ChartArea.AxisX> <telerik:AxisX LabelRotationAngle="45"/> </telerik:ChartArea.AxisX> <i:Interaction.Triggers> <i:EventTrigger EventName="ItemClick"> <cmd:EventToCommand Command="{Binding LoadDetails}" CommandParameter="{Binding ???????"/> </i:EventTrigger> </i:Interaction.Triggers> </telerik:ChartArea> </telerik:ChartDefaultView.ChartArea> </telerik:ChartDefaultView> </telerik:RadChart.DefaultView> </telerik:RadChart>
How do I do this?
Thanks
Phil