Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Xyseries to generic1 #314

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from
Open

Xyseries to generic1 #314

wants to merge 3 commits into from

Conversation

rgwood-github2018dec31
Copy link

Overview: I changed XYseries to accept a list and functions as opposed to forcing clients to create multiple arrays on each create/update.

This is the beginning but I've run out of time tonight. The double[] constuctors still work but, wonce you move to jdk8 you can do something like:

class Foo { double x; double y; double bubbleSz; }

List list= ...
XYSeries ser=new XYSeries("s1", list, axisType
, (list, rowi, obj) -> { return ((Foo)obj).x; }
, (list, rowi, obj) -> { return ((Foo)obj).y; }
, (list, rowi, obj) -> { return ((Foo)obj).bubbleSz; }
);
Had to comment out some code as some libs didn't import into eclipse properly. Hope you can find the time to integrate this and update to jdk8. CHeers!

@timmolter
Copy link
Member

I'm having a hard time understanding what this is doing better since I'm short on time to dedicate brain cells to it. Can you give me a quick summary?

@rgwood-github2018dec31
Copy link
Author

rgwood-github2018dec31 commented May 9, 2019

No problem. The existing code requires one to create arrays to draw a chart. Often one already has say a List_T and so the array creation is not required. Also Let's sat T is:

class StockPrice { double price; double vol; Date dateTime}

Now one just needs to provide a few functions to turn each StockPrice into x and y to draw a graph.

Other than the first comment overview, what more did you wan to to know?

@tomassvensson
Copy link
Contributor

What is the performance impact of this change from double[] arrays to Lists?

@rgwood-github2018dec31
Copy link
Author

rgwood-github2018dec31 commented Sep 18, 2019 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants