PHP User Warning: fetch_template() calls should be replaced by the vB_Template class. Template name: bbcode_highlight in ..../includes/functions.php on line 4197
Handling large datasets in charts quickely-VBForums
Results 1 to 3 of 3

Thread: Handling large datasets in charts quickely

  1. #1

    Thread Starter
    New Member
    Join Date
    Jul 2010
    Posts
    1

    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?

  2. #2
    Not NoteMe SLH's Avatar
    Join Date
    Mar 2002
    Location
    192.168.0.1 Preferred Animal: Penguin Reason for errors: Line#38
    Posts
    3,051

    Re: Handling large datasets in charts quickely

    Not 100&#37; 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.


  3. #3
    VB Addict Pradeep1210's Avatar
    Join Date
    Apr 2004
    Location
    Inside the CPU...
    Posts
    6,614

    Re: Handling large datasets in charts quickely

    See if this helps:
    vb.net Code:
    1. Private Function GetReleventPoints(ByVal allPoints As List(Of Point)) As List(Of Point)
    2.     Const MinXDeviation As Integer = 1
    3.     Const MinYDeviation As Integer = 1
    4.  
    5.     Dim selectedPoints As New List(Of Point)
    6.     Dim lastPt As Point = allPoints.First
    7.     selectedPoints.Add(lastPt)
    8.     For Each pt In allPoints
    9.         If Math.Abs(lastPt.X - pt.X) > MinXDeviation OrElse Math.Abs(lastPt.Y - pt.Y) > MinYDeviation Then
    10.             selectedPoints.Add(pt)
    11.             lastPt = pt
    12.         End If
    13.     Next
    14.     If lastPt <> allPoints.Last Then selectedPoints.Add(allPoints.Last)
    15.     Return selectedPoints
    16. End Function
    Pradeep, Microsoft MVP (Visual Basic)
    Please appreciate posts that have helped you by clicking icon on the left of the post.
    "A problem well stated is a problem half solved." Charles F. Kettering

    Read articles on My Blog 101 LINQ Samples JSON Validator XML Schema Validator "How Do I" videos on MSDN VB.NET and C# Comparison Good Coding Practices VBForums Reputation Saver String Enum Super Simple Tetris Game


    (2010-2013)
    NB: I do not answer coding questions via PM. If you want my help, then make a post and PM me it's link. If I can help, trust me I will...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width