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

Error display when text length >= 12 (text is outsite wheel) #20

Open
AwesomePeople opened this issue Feb 2, 2019 · 7 comments
Open

Comments

@AwesomePeople
Copy link

AwesomePeople commented Feb 2, 2019

Error display when text length >= 12 (text is outsite wheel). Could you set text size smaller or set multi line?

@peterbetos
Copy link
Contributor

peterbetos commented Feb 5, 2019

Pull the latest code, there's already a app:lkwTopTextSize property. Alternatively, you can add "\n" on your text item

@AwesomePeople
Copy link
Author

@peterbetos ,add "\n" to text item not working for both topText and secondaryText.

@NStreet8579
Copy link

Hey u got any solution for this. I'am also facing same issue

@NStreet8579
Copy link

@AwesomePeople

@Nikunj2505
Copy link

@NStreet8579 I am also facing same issue, Is there any workaround?

@Daphne-CoffeeIT
Copy link

I made a terrible hack in the PielView file in the drawSecondaryText method, but it does the job. I only had a little time since I implemented this library while participating in a short hackathon, so I'm not planning on working this out any further. The best way would of course be an actual fix, but since so many people are asking this question I want to share this 'solution'. This code moves the endpoint of the text more towards the center, so more text will fit in the shape.

double margin;
if (textWidth <= 100) {
    margin = 1.7;
} else if (textWidth > 100 && textWidth <= 220) {
    margin = 2;
} else if (textWidth > 220 && textWidth <= 250) {
    margin = 2.5;
} else {
    margin = 3;
}
int x = (int) (mCenter + mRadius / margin / 2 * Math.cos(angle));
int y = (int) (mCenter + mRadius / margin / 2 * Math.sin(angle));

@kishanwrteam
Copy link

    if(mStr.length()>=12){
       mStr= mStr.substring(0,5)+"..";
    }

You can use this single line after some character you can put ..

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

No branches or pull requests

6 participants