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

Refactor Legend Implementation for V5 #9342

Open
etimberg opened this issue Jul 1, 2021 · 2 comments
Open

Refactor Legend Implementation for V5 #9342

etimberg opened this issue Jul 1, 2021 · 2 comments

Comments

@etimberg
Copy link
Member

etimberg commented Jul 1, 2021

The v3 legend implementation is largely carried over from v2 and needs a refactor to match the scriptable options introduced in v3 while at the same time resolving long standing pain points in the code. This ticket is to track that refactor, but since this will be a breaking change it will not be possible to introduce this until v4.

State Changes

  • The legend items & hitboxes state should be combined into a single object

Option Changes

  • generateLabels should not be responsible for determining the item styles. Should consider renaming to generate
  • A legend context should be created for scriptable options
  • Disabled styling should be a property of the scriptable context

Code Changes

  • All of the RTL handling should be moved from the draw method to the fit method
  • The drawing should be a simple loop over the items to draw based on pre-computed properties
@etimberg
Copy link
Member Author

etimberg commented Jul 1, 2021

Related #5564, #4438

@danielgindi
Copy link
Contributor

This is exactly how I do that in the iOS Charts framework. Compute everything upfront, including multiline handling, rotations etc.

@etimberg etimberg removed this from the Version 4.0 milestone Sep 13, 2022
@LeeLenaleee LeeLenaleee changed the title Refactor Legend Implementation for V4 Refactor Legend Implementation for V5 Sep 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants