Quinn-Curtis Forums
Quinn-Curtis Forums
Home | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Tools for Java
 QCChart2D for Java
 Initializing TimeGroupDataset

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
rixmith Posted - 30 Oct 2009 : 12:12:38
I created a OHLCPlot based on a TimeGroupDataset and the example code of DataLoggerView. When I create the dataset using the constructor

TimeGroupDataset(java.lang.String sname, java.util.GregorianCalendar[] x, double[][] y)

everything works perfect. However, when I create the dataset using the default TimeGroupDataset constructor and add the data points one at a time (as is done in the DataLoggerView example) my plot does not show up. As points are added to the dataset I confirmed that the number of points in the dataset is increasing by 1, I can see the scale and the axises being updated correctly on the chart, but no data points are displayed.

When using the default TimeGroupDataset constructor do I have to do some setup before the OHLCPlot will recognize the datapoints?

I notice that the DataLoggerView example preloads some datapoints through the TimeGroupDataset constructor. My question could also be worded as: how would you make the DataLoggerView example work if it had to start with an empty dataset?



Rick
2   L A T E S T    R E P L I E S    (Newest First)
rixmith Posted - 31 Oct 2009 : 21:47:51
Thank you for the quick response.
Works like a charm now.

Rick
quinncurtis Posted - 30 Oct 2009 : 12:48:28
You have to establish the number of groups, which is 4 for an OHLC plot. So you can't use the default constructor. Use the constructor below, which specifies 4 groups, and 0 initial data values. Then add each new set of values.

TimeGroupDataset Dataset1 = new TimeGroupDataset("TimeGroupDataset", 4, 0);		
		
for (i = 0; i < nNumPnts; i++) {
  double [] yvalues = {stockPriceData[0][i], stockPriceData[1][i], stockPriceData[2][i], stockPriceData[3][i]};    
  Dataset1.addTimeGroupDataPoints(xValues[i], yvalues);
}

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