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

Bar Chart - an option to align title, currently the texts are overlapping #105

Closed
atreeon opened this issue Nov 10, 2019 · 7 comments
Closed
Labels
enhancement New feature or request

Comments

@atreeon
Copy link

atreeon commented Nov 10, 2019

With many bars the titles overlap. If we could show the titles vertically that would be great. As a suggestion they could go on top of the bars.

Screenshot 2019-11-10 at 20 17 28

@imaNNeo
Copy link
Owner

imaNNeo commented Nov 10, 2019

Currently, we support showing them at the top of each bar, check it out,
and about the vertical titles, there is an open issue, follow it up.
If this answer satisfied you, feel free to close it.
Thanks!

@atreeon atreeon closed this as completed Nov 10, 2019
@atreeon atreeon reopened this Nov 10, 2019
@atreeon
Copy link
Author

atreeon commented Nov 10, 2019

Thank you again but I couldn't get the title to be displayed on top so I added to the source. Only the y of double was available in the BarChartRodData class so I added a new property; it might be useful for others too.

              return BarTooltipItem(
                "${rod.title}\n${rod.y}%",
                TextStyle(
                  color: Colors.black,
                  fontWeight: FontWeight.bold,
                ),
              );
class BarChartRodData {
  final double y;
  final Color color;
  final double width;
  final bool isRound;
  final BackgroundBarChartRodData backDrawRodData;
  final String title; //added this

@atreeon
Copy link
Author

atreeon commented Nov 10, 2019

It mostly works but when the bars are the same height and narrow then I still get overlapping. It could be useful to have a staggered option where the title is not directly above the bar but cascading from top to bottom so there is a real minimal chance of overlapping (although I guess the align text will help with this anyway)

Screenshot 2019-11-10 at 23 13 06

@imaNNeo
Copy link
Owner

imaNNeo commented Nov 11, 2019

Your use cases are so unique :)
btw let it be open,
we can consider it in the future.

@imaNNeo imaNNeo added the enhancement New feature or request label Nov 11, 2019
@atreeon
Copy link
Author

atreeon commented Nov 12, 2019

As a small work around what I did was order the bars based on how different the values are. I get a bit of an up and down result but much less overlapping.
Screenshot 2019-11-12 at 07 47 48

@imaNNeo
Copy link
Owner

imaNNeo commented Nov 14, 2019

I'm going to close this issue, do you have any request or suggestion except the vertical titles?

@atreeon
Copy link
Author

atreeon commented Nov 14, 2019

No probs

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

No branches or pull requests

2 participants