Hi,
I have created a LineSeries chart which displays a series of Student results. The ToolTip for each result should then show a Drill Down Chart of more detailed results. All the data is called from a WCF service.
The issue I have is the Drill Down chart is showing the results from the previous WCF Result.
i.e. I hover over Student A and no data is shown. I then hover over Student B and Student A's results are shown.
Here is my Code:
Help would really be appreciated.
I have created a LineSeries chart which displays a series of Student results. The ToolTip for each result should then show a Drill Down Chart of more detailed results. All the data is called from a WCF service.
The issue I have is the Drill Down chart is showing the results from the previous WCF Result.
i.e. I hover over Student A and no data is shown. I then hover over Student B and Student A's results are shown.
Here is my Code:
Private Sub ChartArea_ItemToolTipOpening(ByVal tooltip As ItemToolTip2D, ByVal e As ItemToolTipEventArgs)
mService.GetStudentResultsAsync(e.DataSeries.LegendLabel)
tooltip.Content = GetDetailBorder()
End Sub
Private Sub mService_GetStudentResultsCompleted(ByVal sender As Object, ByVal e As ServiceReference1.GetStudentResultsCompletedEventArgs) Handles mService.GetStudentResultsCompleted
Me.DetailChart = New RadChart()
DetailChart.Background = New SolidColorBrush(Colors.Transparent)
DetailChart.DefaultView.ChartLegend.Visibility = Windows.Visibility.Collapsed
DetailChart.Width = 300
DetailChart.Height = 300
Dim Definition As ISeriesDefinition = New LineSeriesDefinition() With {.LegendDisplayMode = LegendDisplayMode.DataPointLabel, .ShowItemLabels = True, .ShowItemToolTips = True}
Dim Mapping As New SeriesMapping() With {.SeriesDefinition = Definition}
Mapping.ItemMappings.Add(New ItemMapping() With {.DataPointMember = DataPointMember.XCategory, .FieldName = "ResultsName"})
Mapping.ItemMappings.Add(New ItemMapping() With {.DataPointMember = DataPointMember.YValue, .FieldName = "Cost"})
DetailChart.SeriesMappings.Add(Mapping)
For Each Test In e.Result
Dim LineSeries As New DataSeries()
Dim LineDefinition As SeriesDefinition = New LineSeriesDefinition()
LineDefinition.ShowItemLabels = False
LineDefinition.ShowItemToolTips = True
LineDefinition.Appearance.PointMark.Shape = MarkerShape.Diamond
Definition.AnimationSettings = New AnimationSettings() With {.ItemAnimationDuration = New TimeSpan(0, 0, 0, 0, 0)}
LineSeries.Definition = Definition
If Not Test.Result2008 = 0 Then LineSeries.Add(New DataPoint(Test.Result2008))
If Not Test.Result2009 = 0 Then LineSeries.Add(New DataPoint(Test.Result2009))
If Not Test.Result2010 = 0 Then LineSeries.Add(New DataPoint(Test.Result2010))
Me.DetailChart.DefaultView.ChartArea.DataSeries.Add(LineSeries)
Next
End Sub
Private Function GetDetailBorder() As Border
Dim NewBorder As New Border() With {.Background = DetailChart.Background, .BorderBrush = New SolidColorBrush(Colors.Blue), .BorderThickness = New Thickness(1), .CornerRadius = New CornerRadius(20), .Padding = New Thickness(5)}
NewBorder.Child = DetailChart
Return NewBorder
End Function
Help would really be appreciated.