TeX - LaTeX Asked by Echo1870 on November 25, 2020
I would like to remove the "complete" after the percentage in the progress label and keep the 60% only, without a digit.
Thank you for your help.
Please find bellow a MWE.
documentclass[11pt]{report}
usepackage{pgfgantt}
usepackage{tikz}
begin{document}
begin{ganttchart}[
vgrid,
hgrid,
bar/.append style={fill=green},
bar incomplete/.append style={fill=red}, progress=today,
today=3,
group progress label node/.append style={below=3pt} ]{1}{12}
gantttitle{Title}{12}
ganttbar{Task 1}{1}{5}
end{ganttchart}
end{document}
The default setting for the progress label text
key is progress label text={#1% complete}
. You can amend this to style the % completion as desired. Here we can write: progress label text={pgfmathprintnumber[fixed, precision=1]{#1}%}
. This writes the text with just the number #1
and %
sign, without complete
. The number is formatted using pgfmathprintnumber[fixed, precision=1]
to give an integer.
documentclass[11pt]{report}
usepackage{pgfgantt}
begin{document}
begin{ganttchart}[
vgrid,
hgrid,
progress label text={pgfmathprintnumber[fixed, precision=1]{#1}%},
bar/.append style={fill=green},
bar incomplete/.append style={fill=red}, progress=today,
today=3,
group progress label node/.append style={below=3pt} ]{1}{12}
gantttitle{Title}{12}
ganttbar{Task 1}{1}{5}
end{ganttchart}
end{document}
Correct answer by Ross on November 25, 2020
Get help from others!
Recent Questions
Recent Answers
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP