Quinn-Curtis Forums
Quinn-Curtis Forums
Home | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Tools for Java
 QCChart2D for Java
 TimeSimpleDataset Y Value

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
KnightHawk Posted - 30 Aug 2007 : 20:08:42
I seem to be having a problem with acquiring the associated double value of a TimeSimpleDataset timeDataPoint.

For example:

TimeSimpleDataset tsd = new TimeSimpleDataset();
GregorianCalendar cal = new GregorianCalendar();
tsd.addTimeDataPoint(cal, 10.0);
(get dataPoint) ... ?


What method do I call to get both the time and associated double from the tsd?

I can get the X Value fine with:

tsd.getTimeXDataValue(0);

but the tsd.getTimeYDataValue() returns a gregorianCalendar, the same calendar saved for the x value, not the saved double I am expecting.

When I try to use the inherited SimpleDataset methods, it provides me with the incorrect number.

For example:
tsd.getDataPoint(0).getY() returns 0, not 10.


Is there a work around for this problem?
2   L A T E S T    R E P L I E S    (Newest First)
KnightHawk Posted - 31 Aug 2007 : 11:18:48
Thank you.
quinncurtis Posted - 31 Aug 2007 : 02:28:02
Normally you pass in arrays of data values to create the dataset, as all of our examples do. That defines which coordinate is the time coordinate, x or y. In your case you are using the default constructor where you must explicity set it.

TimeSimpleDataset tsd = new TimeSimpleDataset();
tsd.setXCoordinateType(ChartObj.TIME_COORDINATE);
GregorianCalendar cal = new GregorianCalendar();
tsd.addTimeDataPoint(cal, 10.0);

GregorianCalendar x = tsd.getTimeXDataValue(0);
double y = tsd.getYDataValue(0);

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