Quinn-Curtis Forums
Quinn-Curtis Forums
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Tools for Java
 QCChart2D for Java
 TimeSimpleDataset Y Value
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

KnightHawk

22 Posts

Posted - 30 Aug 2007 :  20:08:42  Show Profile  Reply with Quote
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?

quinncurtis

1164 Posts

Posted - 31 Aug 2007 :  02:28:02  Show Profile  Reply with Quote
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);
Go to Top of Page

KnightHawk

22 Posts

Posted - 31 Aug 2007 :  11:18:48  Show Profile  Reply with Quote
Thank you.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Quinn-Curtis Forums © 2000-07 Quinn-Curtis, Inc. Go To Top Of Page
Powered By: Snitz Forums 2000 Version 3.4.07