Quinn-Curtis Forums
Quinn-Curtis Forums
Home | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Tools for Microsoft .Net & .Net Compact Framework
 QCChart2D and QCChart2D CF (VB and C#)
 Adding dataset to dataset

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkInsert EmailInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
   

T O P I C    R E V I E W
fsjodin Posted - 18 Apr 2007 : 16:30:11
I would like to add a TimeSimpleDataset to another TimeSimpleDataset and end up with one dataset which has all the points from the two. For example, if the first data set has X values between 1/1/2007 and 1/31/2007 and the second has X values between 2/1/2007 and 2/28/2007 then I would like to end up with one dataset with values from 1/1/2007 and 2/28/2007.

I looked at CombineDataset method and it seems to be, as its name implies, perform a combination of the datasets.

What would the recommended way be to do what I am wanting to do? I know how to do it 'manually' by allocating new arrays, looping over the data and combining them that way but if there is a convenient / efficient way to do it through the APIs that would be even better.

Thanks
4   L A T E S T    R E P L I E S    (Newest First)
fsjodin Posted - 19 Apr 2007 : 11:35:43
Thanks, that is good to know
quinncurtis Posted - 18 Apr 2007 : 21:29:19
No, the datasets do not reallocate the internal buffers with each new added data point. The data buffers are up to twice as big as they need to be, to minimize reallocations when new data points are added. When the buffers do get reallocated, the are sized at twice as big as they need to be.
fsjodin Posted - 18 Apr 2007 : 21:21:20
Is copying the points one-by-one reallocating the underlying array for each point? If so the copy would be inefficient for large data sets. Since both data sets are known, recreating the SimpleTimeDataset, reallocating the ChartCalendar array and y-axis arrays and using Array.Copy is probably more efficient. I was looking to see if there was a built-in API function that worked in that fashion, which I take it there is not, which is fine.

Thanks
quinncurtis Posted - 18 Apr 2007 : 17:10:32
We don't have anything simplier than just appending the points one by one. You don't need the SortByX if you already know that the Dataset2 points are after the Dataset1 points.

TimeSimpleDataset Dataset1 = new TimeSimpleDataset(...);
TimeSimpleDataset Dataset2 = new TimeSimpleDataset(...);
.
.
for ( i=0; i < Dataset2.NumberDatapoints; i++)
	Dataset1.AddDataPoint(Dataset2.GetDataPoint(i));
Dataset1.SortByX(true);

Quinn-Curtis Forums © 2000-07 Quinn-Curtis, Inc. Go To Top Of Page
Powered By: Snitz Forums 2000 Version 3.4.07