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

Problem with adding datapoints to a series

1 Answer 51 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Robert
Top achievements
Rank 1
Robert asked on 25 Aug 2011, 07:30 PM
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
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

1 Answer, 1 is accepted

Sort by
0
Tsvetie
Telerik team
answered on 30 Aug 2011, 12:56 PM
Hello Robert,
I could not quite understand the problem that you report. Could you please explain in detail the result that you get the one that you expect?

On a side note, I reviewed your code and it looks correct. The only thing that I can suggest, is that you debug your code to make sure that there are data entries that fulfill your condition and that some DataPoints actually are added to the DataSeries. In case this suggestion does not help you, please open a formal support ticket and send me a simple running project that demonstrates the problem that you have.

Kind regards,
Tsvetie
the Telerik team

Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

Tags
Chart
Asked by
Robert
Top achievements
Rank 1
Answers by
Tsvetie
Telerik team
Share this question
or