Hey, This is my very first post on these forums and I hate to open up like this. But i have a problem with my Silverlight 3rd year project where i want to populate datapoints in a dataseries. I'm using the following code to to read values from a database and then populate the radchart with the data ( a line series), if any pointers can be given I would very much appreciate it.
Dim boithusocontext As BoithusoDomainContext = New BoithusoDomainContext
Dim ds As DataSeries = New DataSeries
ds.Definition = New LineSeriesDefinition()
Dim q = From c In boithusocontext.MiniMentalTestResults
Select c
Dim listResults As List(Of MiniMentalTestResult) = q.ToList()
For Each c As MiniMentalTestResult In listResults
If c.Pat_ID = patidActive Then
ds.Add(New DataPoint(c.MiniMTestResults)) 'In the line series
End If
Next
RadChart1.DefaultView.ChartArea.DataSeries.Add(ds)
My coding skills are really bad, I dont know if the problem lies with my logic of reading the data into the dataseries or what im doing wrong?
The data in the MiniMentalTestResults table is as follows:
MiniMtest_ID MiniMTestDate MiniMTestResults Pat_ID
Dim boithusocontext As BoithusoDomainContext = New BoithusoDomainContext
Dim ds As DataSeries = New DataSeries
ds.Definition = New LineSeriesDefinition()
Dim q = From c In boithusocontext.MiniMentalTestResults
Select c
Dim listResults As List(Of MiniMentalTestResult) = q.ToList()
For Each c As MiniMentalTestResult In listResults
If c.Pat_ID = patidActive Then
ds.Add(New DataPoint(c.MiniMTestResults)) 'In the line series
End If
Next
RadChart1.DefaultView.ChartArea.DataSeries.Add(ds)
My coding skills are really bad, I dont know if the problem lies with my logic of reading the data into the dataseries or what im doing wrong?
The data in the MiniMentalTestResults table is as follows:
MiniMtest_ID MiniMTestDate MiniMTestResults Pat_ID
1 | 6/20/2011 12:00:00 AM | 20 | 1 |
2 | 12/5/2008 12:00:00 AM | 18 | 8 |
3 | 5/5/2009 12:00:00 AM | 17 | 19 |
4 | 4/12/2010 12:00:00 AM | 19 | 24 |
5 | 1/5/2009 12:00:00 AM | 20 | 1 |
6 | 6/21/2011 12:00:00 AM | 22 | 8 |
7 | 7/7/2011 12:00:00 AM | 23 | 19 |
8 | 7/7/2011 12:00:00 AM | 20 | 24 |
9 | 8/23/2011 12:00:00 AM | 9 | 40 |