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

addEntryOrdered behavior - clarification #1242

Closed
popaaaandrei opened this issue Jul 12, 2016 · 1 comment
Closed

addEntryOrdered behavior - clarification #1242

popaaaandrei opened this issue Jul 12, 2016 · 1 comment

Comments

@popaaaandrei
Copy link

popaaaandrei commented Jul 12, 2016

Dear All,

First of all, thank you for putting the effort, the library is super-cool.

My problem is data-related. I need to be able to insert entries at custom X locations so I tried using addEntryOrdered. This is what happens when I try to insert at index 1, value 62. From the name, I was expecting a linked-list like behavior, but it seems that the entries are not redistributed.

screen shot 2016-07-12 at 09 10 21

First question: is this the desired behavior or am I missing something?
Right now, the only way I was able to achieve this is to reset data/set entirely at every entry insert operation. I didn't find any move / redistribute call.

Second question: does every addEntry / addEntryOrdered need to be paired with a corresponding data.addXValue call?

Thank you!
Andrei

@danielgindi
Copy link
Collaborator

Data should always be ordered. Otherwise, the library cannot know that it reached an out-of-view x value, and will evaluate every possible x for whether it needs to be rendered.

addEntry means you know that the order is correct - and the library can avoid searching for the correct position in the array to add it.
addEntryOrderer looks for the position in the array to add it to.

The ordering is on the x axis only. A higher Y value can logically still appear before a lower one.

addXValue should be called for x-indices which did not exist before... Anyway in Charts 3.0 this concept has gone away.

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

No branches or pull requests

2 participants