Open thombergs opened 10 years ago
i'm using DATETIME type Axis in my project, and it works just fine with Points in PointSeries.
To add Date value in x Axis i'm using such code: Date someDate = new Date(); Point point = new Point(someDate.getTime(), 100);
With Date.getTime() you'll get timestamp and your chart will be rendered correct (for example with gaps on days that are not added to series).
You're right, that seems to work too :) Thanks for the tip. It still think however this change would make life easier in some cases, allowing all types of values for X and Y and adding a constructor to provide the X value.
Thanks for the patch! I will have a look at it for the next release. Since it would break the API, I would probably create a new class "GenericPoint<X,Y>" instead of adding the generic types to the existing Point class.
Reported by pepijn@dvelop.nl, Aug 27, 2013 The current implementation of Point does not allow value types other then Number. This makes it impossible to properly use the Axis type 'DATETIME'. This patch makes the X and Y fields of Point generic, so other types can be used. It also adds a JSON serializer for java.util.Date instances.