kurtomerfaruk / wicked-charts

Automatically exported from code.google.com/p/wicked-charts
0 stars 0 forks source link

Patch: allow Point value types other then Number #46

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
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.

Original issue reported on code.google.com by pep...@dvelop.nl on 27 Aug 2013 at 11:11

Attachments:

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Patch attached. I hope it's in the right format...

Original comment by pep...@dvelop.nl on 27 Aug 2013 at 12:13

Attachments:

GoogleCodeExporter commented 9 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).

Original comment by bartlomiej.lopatka on 30 Aug 2013 at 5:17

GoogleCodeExporter commented 9 years ago
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.

Original comment by pep...@dvelop.nl on 30 Aug 2013 at 10:18

GoogleCodeExporter commented 9 years ago
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.

Original comment by tom.homb...@gmail.com on 30 Aug 2013 at 6:09

GoogleCodeExporter commented 9 years ago
moved issue to github at https://github.com/thombergs/wicked-charts/issues/15

Original comment by tom.homb...@gmail.com on 21 Apr 2014 at 11:52