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); |
|
|