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
feat(widgets/chart): add option to set the position of legend #378
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #378 +/- ##
=======================================
+ Coverage 91.3% 91.4% +0.1%
=======================================
Files 42 42
Lines 12992 13355 +363
=======================================
+ Hits 11868 12218 +350
- Misses 1124 1137 +13 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd suggest also adding / updating the existing chart example to show the legend positioning:
I'll fix CI and add more test codes. And I make commits cumulativly. |
CI failed because of
|
Done - not sure why this fails. I have been meaning to look into it more. |
d009f3d
to
e2f65a2
Compare
Update chart examples all code requested changes. At this time, rebase to main branch, CI failed. But CI failed due to an other reason. Here is error. Can't use 'tar -xzf' extract archive file: /home/runner/work/_actions/_temp_fcc1cf2d-bf9a-43b0-8047-ca17e1e0339a/f92c391d-66ef-45d5-9351-73185dd01cc5.tar.gz |
Rebase to main branch a7bf4b3. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mainly this needs documentation.
Also could you rebase on main, this PR has been hanging for quite a while now ...
- update rendering algorithm to avoid collisiion with axis titles. - add unit tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, thank you for your contribution!
Just missing an approval from @joshka |
Migerated PR from tui-rs is #25
Add option to position the legend at corner. The option uses tui::layout::Corner emum that already made.
If the layout have axis title, the layout draw the legend position above x axis title or under y axis title.
Examples all positions of legend
I make 3 tests for each corners of legend based on original test for legend.