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

BarLabel Decorator cosniders TextDirection #22

Closed
wants to merge 2 commits into from
Closed

BarLabel Decorator cosniders TextDirection #22

wants to merge 2 commits into from

Conversation

AITechNassim
Copy link

No description provided.

Computing the labelX by taking into consideration the TextDirection
@AITechNassim
Copy link
Author

#21

Copy link
Member

@winksaville winksaville left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@AITechNassim, Thanks so much for porting this to here!

One other suggestion, I always like to add tests if possible. It looks there there are some tests in charts_common_cf/test/chart/bar/bar_label_decorator_test.dart. I see at least two RTL tests:

test('RTL TextAnchor.start starts on the right', () {
test('RTL TextAnchor.end starts on the left', () {

Please try to enhance those tests so that the code paths you changed are tested. Ideally the tests will fail before applying these changes and succeed afterwards.

@@ -311,12 +311,19 @@ class BarLabelDecorator<D> extends BarRendererDecorator<D> {

switch (anchor) {
case BarLabelAnchor.middle:
labelX = (bounds.left +
labelElement.textDirection = rtl ? TextDirection.rtl : TextDirection.ltr;
Copy link
Member

@winksaville winksaville Jun 6, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking at this it looks like we can refactor line 314 to be outside of the if (calculateLabePosition == BarLabelPosition.inside) { above line 308 and then remove it below from lines 337, 340 and 346.

@winksaville
Copy link
Member

@AITechNassim I've released a new version of charts_cf, 0.10.3+cf. In this release I fixed the two bugs I ran into and created a release process. I'd love to get feed back on its current state as well as having the next release contian this PR and @dreamnice's PR #9.

If either of you have feed back for me charts_cf or need help on your PR's don't hesitate to ask.

@AITechNassim
Copy link
Author

@winksaville Thanks for the update. Unfortunatly, I cannot do any test before the next two weeks. I have a lot of work :( .
I will do the test just after.
Thanks.

@winksaville
Copy link
Member

winksaville commented Jun 12, 2020 via email

@AITechNassim AITechNassim closed this by deleting the head repository Oct 14, 2023
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.

2 participants