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

Misplaced label text caused by rotation #17

Open
Arinerron opened this issue Jun 2, 2023 · 7 comments
Open

Misplaced label text caused by rotation #17

Arinerron opened this issue Jun 2, 2023 · 7 comments
Labels
bug Something isn't working

Comments

@Arinerron
Copy link

image

\begin{tikzpicture}[]
\pie[hide number=true,text=inside,scale=0.9,sum=auto,rotate=80,lines/.style={draw=\thecolor,none},hide number=true,before number=,after number=]{
    11/A,
    4/B,
    1/C,
    4/D
}
\end{tikzpicture}

(also, any idea why is the text aligned so weirdly loool)

@muzimuzhi
Copy link
Member

Can't reproduce your result (only "A" has "11%"). Can you provide a complete example?

It seems the the text positioning issue is caused by the rotation

\documentclass{article}
\usepackage{pgf-pie}

\begin{document}
\noindent
\foreach \i in {0,10,...,90} {%
  \begin{tikzpicture}
    \pie[hide number=true,text=inside,sum=auto,rotate=\i,radius=2]{
        11/A,
        4/B,
        1/C,
        4/D
    }
  \end{tikzpicture}
}
\end{document}

image

@Arinerron
Copy link
Author

Arinerron commented Jun 2, 2023

The percent issue I found to be this stupid renewcommand on \pie that somehow made its way into our LaTeX document. I can close the issue if you want and open a separate one for the rotation issue, or rename this? (whichever you prefer)

muzimuzhi added a commit to muzimuzhi/pgf-pie that referenced this issue Jun 3, 2023
@muzimuzhi muzimuzhi changed the title Bug: hide number not working Misplaced label text caused by rotation Jun 3, 2023
muzimuzhi added a commit to muzimuzhi/pgf-pie that referenced this issue Jun 3, 2023
@muzimuzhi
Copy link
Member

muzimuzhi commented Jun 3, 2023

Issue renamed.

The problem is caused by the newline \\ inserted between label text and number text. The newline should be omitted if one of label or number text is hidden.

I've prepare a patch, see master...muzimuzhi:pgf-pie:optional-newline, but first the workflow file main.yml need to be updated.

@muzimuzhi muzimuzhi added the bug Something isn't working label Jun 3, 2023
@Arinerron
Copy link
Author

Nice catch haha, I'll test it next time I'm on my laptop. And thanks for the quick response and fix :) this library is a lifesaver tbh

@Arinerron
Copy link
Author

lgtm, thanks again

@muzimuzhi
Copy link
Member

Let's keep this open until a fix for it is released.

@muzimuzhi muzimuzhi reopened this Jun 13, 2023
@Leative
Copy link

Leative commented Jul 12, 2024

Just came across that problem, fixed it and wanted to provide a quick PR. But now I realize this issue and a fix already exist. What prevents this from being released?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

No branches or pull requests

3 participants