I think all of the problems has been asked by me or others in the past. But my over all problem is that I am not able to combine all this solutions to the real picture I want to draw. Normally it is nice to seperate a complex problem into more simple ones and ask. But here I try to ask the complex question because I experienced that the solutions influence (in my case negativ) each other.
Description of the needs/prolems:
- The left nodes (
Phase
) should be rotaed. I would prefere a solution with\rotatebox
(node contents={\rotatebox{90}{#1}}}
). - The nodes (better would be rows) on the right are centered horizontal.
- Logical the picture have four rows and the nodes on the left and right need to display that. This means that one node (e.g.
right of B
) is centered vertical against its left node. Please see thatPhaseC
belongs toC1
,C2
andlong C3
, so that the vertical alignment should represent that. (discussed here) - Connecting the nodes with arrow shouldn't be so hard I think.
- All have to be done relative. That means no
cm
,mm
,pt
or something like that. - The number of nodes is not fixed. It could be that in row one are less nodes then in row four.
Some solutions:
\documentclass[tikz]{standalone}
\usepackage{xltxtra}
\usepackage{polyglossia}
\setdefaultlanguage[spelling=new]{german}
\usepackage{tikz}
\usetikzlibrary{scopes,matrix,positioning,chains}
\begin{document}
\begin{tikzpicture}
[
items/.style = {
draw,
align=center},
phase/.style = {
items,
fill=red!20,
node contents={\rotatebox{90}{#1}}}
]
{[
start chain=P going below
]
\node [on chain,phase=PhaseA];
{[
start branch=A going right,
every on chain/.append style=items,
every node/.style=on chain
]
\node {One};
\node {Two};
\node {Three};
\node {Four};
}
\node [on chain,phase=PhaseB];
\node [on chain,phase=PhaseC];
\node [on chain,phase=PhaseD];
{[
start branch=D going right,
every on chain/.append style=items,
every node/.style=on chain
]
\node {D1};
\node {D2};
}
}
% B
\node [right=of P-2,items] {right of B};
% C
\matrix (C) [
matrix of nodes,
row sep=5pt, %2\textheight doesn't work here, maybe a \nodeheight exists?
every node/.append style=items,
right=of P-3]
{
C1 \\
C2 \\
long C3\\
};
\end{tikzpicture}
\end{document}
Produce this
Number 2 and 5 are not fullfilled. And I think number 6 would make problems in the future.