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

feature suggestion: ability to rotate titlesData text #75

Closed
mahmoudparandeh opened this issue Sep 29, 2019 · 12 comments
Closed

feature suggestion: ability to rotate titlesData text #75

mahmoudparandeh opened this issue Sep 29, 2019 · 12 comments
Labels
enhancement New feature or request

Comments

@mahmoudparandeh
Copy link

hi there, thanks for your great library. as you know when the bottomTitles are more for example months. if we can rotate text for example 90 degrees we can handle long text in bottomTitles. if you need more info i can create image for that.

@mahmoudparandeh
Copy link
Author

rotate
some think like this one, i hear about RotatedBox which rotate child widget. maybe its helped.

@imaNNeo
Copy link
Owner

imaNNeo commented Sep 29, 2019

Hi, That's great,
We will implement it soon, also pull requests are welcome,
stay tuned, Thanks!

@imaNNeo imaNNeo added the enhancement New feature or request label Sep 29, 2019
@mahmoudparandeh
Copy link
Author

hi, there. don't forget this in next release. thanks :)

@imaNNeo
Copy link
Owner

imaNNeo commented Dec 12, 2019

Hi there, long time no see :)
It has been added in 0.6.0, now we have rotateAngle property in our SideTitles, you can use it to rotate the titles.
Thank you for suggesting, and thanks @arefhosseini for implementing.

Sample 5 (Source Code)

@imaNNeo imaNNeo closed this as completed Dec 12, 2019
@imaNNeo
Copy link
Owner

imaNNeo commented Dec 12, 2019

I think it is the first teamwork that happened between three Iranians in the Flutter community :)
I like that.
Thanks a lot.

@arefhosseini
Copy link
Contributor

Yeah I get more motivation for developing flutter. Thank to both of you.

@wiany11
Copy link

wiany11 commented May 5, 2023

Not anymore...?

@imaNNeo
Copy link
Owner

imaNNeo commented May 5, 2023

Not anymore...?

What do you mean?

@wiany11
Copy link

wiany11 commented May 6, 2023

@imaNNeo

fl_chart: ^0.61.0
  FlTitlesData get titlesData => FlTitlesData(
    show: true,
    bottomTitles: AxisTitles(
      sideTitles: SideTitles(
        showTitles: true,
        reservedSize: 30,
        getTitlesWidget: getTitles,
        //rotateAngle: -90,  // The named parameter 'rotateAngle' isn't defined. (Documentation)
      ),
    ),
    ...,
  );

I am currently using like the above. (Thanks for the beautiful library!)
But I cannot add the property rotateAngle to SideTitles or somewhere else...
Is the property no long supported...?

@imaNNeo
Copy link
Owner

imaNNeo commented May 6, 2023

You can override the getTitlesWidget to rotate the widgets (for example using Transform.rotate widget)

Please check the 0.50.0 migration guide

@wiany11
Copy link

wiany11 commented May 6, 2023

@imaNNeo Thank you so much!

  FlTitlesData get titlesData => FlTitlesData(
    show: true,
    bottomTitles: AxisTitles(
      sideTitles: SideTitles(
        showTitles: true,
        reservedSize: 30,
        getTitlesWidget: Transform.translate(
          offset: const Offset(0.0, 10.0),
          child: Transform.rotate(
            angle: - pi / 4,
            child: SideTitleWidget(
              axisSide: meta.axisSide,
              space: 4,
              child: Text(text, style: style),
            ),
          ),
        ),
      ),
    ),
    ...,
  );

@imaNNeo
Copy link
Owner

imaNNeo commented May 6, 2023

You're welcome 🎉

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

4 participants