|
-
Jul 14th, 2010, 03:41 AM
#1
Thread Starter
New Member
Handling large datasets in charts quickely
I have a collection of 50000 points List<DataPoint> DataPoints;Each item in this collection contains (X,Y) co ordinates.These points have to be drawn using line and path in my line chart.Canvas size may vary.Drawing the entire collection will increase the load time.Hence I need to filter the points in such a way that I can get a sub collection of lesser number of points and this list will not affect shape of the chart to larger extent and also renders quickly.Suppose there are points like (1,2)(2,4)(3,6) which passes through same line.I can exclude(2,4).This method can be used as a first order filter.Can anyone please suggest or help me out how I can filter it further.Like excluding points which are very close to each other?
-
Jul 15th, 2010, 08:40 AM
#2
Not NoteMe
Re: Handling large datasets in charts quickely
Not 100% sure what you're after, but you could combine your 2 ideas (filtering out colinear points and points close to each other) and filter out points very nearly colinear (along the same line). e.g.
(1,2)(2,3.99)(3,6)
Last edited by SLH; Jul 15th, 2010 at 10:03 AM.
Quotes:
"I am getting better then you guys.." NoteMe, on his leet english skills.
"And I am going to meat her again later on tonight." NoteMe
"I think you should change your name to QuoteMe" Shaggy Hiker, regarding NoteMe
"my sweet lord jesus. I've decided never to have breast implants" Tom Gibbons
Have I helped you? Please Rate my posts. 
-
Jul 15th, 2010, 09:08 AM
#3
Re: Handling large datasets in charts quickely
See if this helps:
vb.net Code:
Private Function GetReleventPoints(ByVal allPoints As List(Of Point)) As List(Of Point) Const MinXDeviation As Integer = 1 Const MinYDeviation As Integer = 1 Dim selectedPoints As New List(Of Point) Dim lastPt As Point = allPoints.First selectedPoints.Add(lastPt) For Each pt In allPoints If Math.Abs(lastPt.X - pt.X) > MinXDeviation OrElse Math.Abs(lastPt.Y - pt.Y) > MinYDeviation Then selectedPoints.Add(pt) lastPt = pt End If Next If lastPt <> allPoints.Last Then selectedPoints.Add(allPoints.Last) Return selectedPoints End Function
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|