Current location: Hot Scripts Forums » Programming Languages » Windows .NET Programming » Handling large datasets in charts quickely


Handling large datasets in charts quickely

Reply
  #1 (permalink)  
Old 07-14-10, 04:50 AM
sharmilakumari sharmilakumari is offline
New Member
 
Join Date: Jul 2010
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
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 with an algorithm how I can filter it further.Like excluding points which are very close to each other?
Reply With Quote
  #2 (permalink)  
Old 07-16-10, 10:12 AM
digioz's Avatar
digioz digioz is offline
Community VIP
 
Join Date: Oct 2003
Location: Chicago, IL
Posts: 2,171
Thanks: 3
Thanked 9 Times in 9 Posts
Quote:
Originally Posted by sharmilakumari View Post
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 with an algorithm how I can filter it further.Like excluding points which are very close to each other?
Have you considered using a Generic List instead of dataset? In most cases a Generic List would increase load speed by a factor of 50!

Pete
__________________
Reply With Quote
  #3 (permalink)  
Old 08-13-10, 05:05 AM
m.timoney's Avatar
m.timoney m.timoney is offline
Newbie Coder
 
Join Date: Jan 2007
Location: Leicester - UK
Posts: 76
Thanks: 1
Thanked 0 Times in 0 Posts
you can use trig to compare them

for example tan( (y[i+1]-y[i-1]) / (x[i+1]-x[i-1])) = tan( (y[i+1]-y[i]) / (x[i+1]-x[i]))
will tell you if the point at location i is in line with the one before and after (i think been a while since college trig classes)

add and error margin rather than a straight = and you can check for almost in the some line
__________________
Definition of a Beginner, Someone who doesn't know the rules.

Definition of an Expert, Someone who knows when to ignore the rules.
Reply With Quote
Reply

Bookmarks

Tags
csharp, silverlight


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump


All times are GMT -5. The time now is 02:19 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.