Graphics, Figures & TablesPGFGantt Bar Label Loction and Improvement

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
oozypal
Posts: 12
Joined: Fri Dec 21, 2012 8:46 am

PGFGantt Bar Label Loction and Improvement

Post by oozypal »

How can I Make the bar label above, to the right or left of the bar. I tried but it does not seem to work. Also if you can make it look better. My code and :

gantt.png
gantt.png (46.15 KiB) Viewed 4316 times

Code: Select all

\begin{ganttchart}[
 hgrid style/.style={black, dotted},
 inline,
  progress label text=\relax,
  today=05-11-2020,
  today label=Today,
  today label font=\color{red!50!black},
  today rule/.style={draw=black!50!white, dashed,thin},
  x unit=.36mm,
  y unit chart=10mm,
  y unit title=10mm,
  time slot format=little-endian,
  group label font=\normalsize,
  link/.style={->, thin},
  ]{01-11-2020}{31-12-2021}
  \gantttitlecalendar{year, month=shortname}\\
  \ganttgroup[group/.append style={fill=orange}]{Group}{01-11-2020}{30-05-2021}\\ [grid]
  \ganttorangebar[name=Start,bar inline label node/.style={above=3pt}]{Start}{21-11-2020}  {21-11-2020}\\ [grid]
\ganttorangebar[name=Data]{Data}{10-12-2020}{10-12-2020}\\ [grid]
\ganttorangebar[name=Shortlist,bar inline label node/.style={left}]{Shortlist}{21-12-2020}{08-01-2021} \\ [grid]
\ganttorangebar[name=Insp,  bar label inline anchor/.style=right]{Inspection}{08-01-2021}{31-03-2021} \\ [grid]
\ganttorangebar[name=Offer]{Offers}{01-03-2021}{30-04-2021} \\ [grid]
\ganttbar[bar label inline anchor/.style=above]{Task 2}{01-04-2021}{30-05-2021}\\
\ganttlink[link mid=0.5]{Start}{Data}
\ganttlink{Data}{Shortlist}
\ganttlink[link mid=.5, link bulge=5]{Shortlist}{Insp}
\ganttlink[link mid=.5, link bulge=6]{Insp}{Offer}  
\end{ganttchart}
\end{document}
Note: https://tex.stackexchange.com/questions ... mprovement
Last edited by oozypal on Tue Nov 10, 2020 10:47 pm, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
Bartman
Posts: 366
Joined: Fri Jan 03, 2020 2:39 pm

PGFGantt Bar Label Loction and Improvement

Post by Bartman »

Please help possible helpers to save time by linking your crossposts.

It would be desirable to enjoy a full Infominimal working example here as well.
oozypal
Posts: 12
Joined: Fri Dec 21, 2012 8:46 am

PGFGantt Bar Label Loction and Improvement

Post by oozypal »

Here is the MWE

Code: Select all

\documentclass{standalone}
\usepackage{pgfgantt}
\usepackage{tikz}
\begin{document}
\setganttlinklabel{f-s}{}
\newganttchartelement{orangebar}{
	orangebar/.style={
		inner sep=0pt,
		draw=red!66!black,
		very thin,
		top color=white,
		bottom color=orange!80,
	},
	orangebar label font=\slshape\small,
	orangebar left shift=.1,
	orangebar right shift=-.1
}

\newganttchartelement{bluebar}{
	bluebar/.style={
		inner sep=0pt,
		draw=purple!44!black,
		thin,
		top color=white,
		bottom color=blue!80
	},
	bluebar label font=\slshape\small,
	bluebar left shift=.1,
	bluebar right shift=-.1
}

\newganttchartelement{greenbar}{
	greenbar/.style={
		inner sep=0pt,
		draw=green!50!black,
		very thick,
		top color=white,
		bottom color=green!80
	},
	greenbar label font=\slshape\small,
	greenbar left shift=.1,
	greenbar right shift=-.1
}

\begin{ganttchart}[
	hgrid style/.style={black, dotted},
	inline,
	progress label text=\relax,
	today=05-11-2020,
	today label=Today,
	today label font=\color{red!50!black},
	today rule/.style={draw=black!50!white, dashed,thin},
	x unit=.36mm,
	y unit chart=10mm,
	y unit title=10mm,
	time slot format=little-endian,
	group label font=\normalsize,
	link/.style={->, thin},
	]{01-11-2020}{31-12-2021}
	\gantttitlecalendar{year, month=shortname}\\
	\ganttgroup[group/.append style={fill=orange}]{Group}{01-11-2020}{30-05-2021}\\ [grid]
	\ganttorangebar[name=Start,bar inline label node/.style={above=3pt}]{Start}{21-11-2020}{21-11-2020}\\ [grid]
	\ganttorangebar[name=Data]{Data}{10-12-2020}{10-12-2020}\\ [grid]
	\ganttorangebar[name=Shortlist,bar inline label node/.style={left}]{Shortlist}{21-12-2020}{08-01-2021} \\ [grid]
	\ganttorangebar[name=Insp,  bar label inline anchor/.style=right]{Inspection}{08-01-2021}{31-03-2021} \\ [grid]
	\ganttorangebar[name=Offer]{Offers}{01-03-2021}{30-04-2021} \\ [grid]
	\ganttbar[bar label inline anchor/.style=above]{Task 2}{01-04-2021}{30-05-2021}\\
	\ganttlink[link mid=0.5]{Start}{Data}
	\ganttlink{Data}{Shortlist}
	\ganttlink[link mid=.5, link bulge=5]{Shortlist}{Insp}
	\ganttlink[link mid=.5, link bulge=6]{Insp}{Offer}	
\end{ganttchart}
\end{document}
oozypal
Posts: 12
Joined: Fri Dec 21, 2012 8:46 am

PGFGantt Bar Label Loction and Improvement

Post by oozypal »

Can anyone please support me in this issue?
Post Reply