von windpower » Di 7. Jun 2016, 10:44
Ich habe eine Breakdown Structure mit Hilfe einer Vorlage erstellt. Für die weitere Ausarbeitung versuche ich nun, die einzelnen Unterarme separat darzustellen und bekomme es leider nicht hin...
Also Ziel wäre, den ersten Ast Child 1 mit, A1-3, ohne Root darzustellen. Habe versucht, Child1 zur root zu machen aber das klappt irgendwie nicht... Vorschläge?
\documentclass[pdftex]{scrbook}
\usepackage[german, english]{babel}
\usepackage{tikz}
\usetikzlibrary{shapes,arrows}
\usetikzlibrary{positioning}
\begin{document}
\begin{center}
\tikzset{
basic/.style = {draw, text width=3cm, rectangle},
root/.style = {basic, rounded corners=2pt, thin, align=center,
fill=green!10},
level 2/.style = {basic, rounded corners=6pt, thin,align=center, fill=green!30,
text width=7em},
level 3/.style = {basic, thin, align=left, fill=pink!50, text width=7em}
}
\begin{figure}[htbp]
\begin{tikzpicture}[
level 1/.style={sibling distance=40mm},
edge from parent/.style={->,draw},
>=latex]
% root of the the initial tree, level 1
\node[root] {Root}
% The first level, as children of the initial tree
child {node[level 2] (c1) {Child1}}
child {node[level 2] (c2) {Child2}}
child {node[level 2] (c3) {Child3}}
child {node[level 2] (c4) {Child4}};
% The second level, relatively positioned nodes
\begin{scope}[every node/.style={level 3}]
\node [below=10pt of c1, xshift=15pt] (c11) {A1};
\node [below=10pt of c11] (c12) {A2};
\node [below=10pt of c12] (c13) {A3};
\node [below=10pt of c2, xshift=15pt] (c21) {B1};
\node [below=10pt of c21] (c22) {B2};
\node [below=10pt of c22] (c23) {B3};
\node [below=10pt of c23] (c24) {B4};
\node [below=10pt of c3, xshift=15pt] (c31) {C1};
\node [below=10pt of c31] (c32) {C2};
\node [below=10pt of c32] (c33) {C3};
\node [below=10pt of c4, xshift=15pt] (c41) {D1};
\node [below=10pt of c41] (c42) {D2};
\end{scope}
% lines from each level 1 node to every one of its "children"
\foreach \value in {1,2,3}
\draw[->] (c1.195) |- (c1\value.west);
\foreach \value in {1,...,4}
\draw[->] (c2.195) |- (c2\value.west);
\foreach \value in {1,2,3}
\draw[->] (c3.195) |- (c3\value.west);
\foreach \value in {1,2}
\draw[->] (c4.195) |- (c4\value.west);
\end{tikzpicture}
\caption{Breakdown}
\end{figure}
\end{center}
\end{document}
Ich habe eine Breakdown Structure mit Hilfe einer Vorlage erstellt. Für die weitere Ausarbeitung versuche ich nun, die einzelnen Unterarme separat darzustellen und bekomme es leider nicht hin...
Also Ziel wäre, den ersten Ast Child 1 mit, A1-3, ohne Root darzustellen. Habe versucht, Child1 zur root zu machen aber das klappt irgendwie nicht... Vorschläge?
[code]
\documentclass[pdftex]{scrbook}
\usepackage[german, english]{babel}
\usepackage{tikz}
\usetikzlibrary{shapes,arrows}
\usetikzlibrary{positioning}
\begin{document}
\begin{center}
\tikzset{
basic/.style = {draw, text width=3cm, rectangle},
root/.style = {basic, rounded corners=2pt, thin, align=center,
fill=green!10},
level 2/.style = {basic, rounded corners=6pt, thin,align=center, fill=green!30,
text width=7em},
level 3/.style = {basic, thin, align=left, fill=pink!50, text width=7em}
}
\begin{figure}[htbp]
\begin{tikzpicture}[
level 1/.style={sibling distance=40mm},
edge from parent/.style={->,draw},
>=latex]
% root of the the initial tree, level 1
\node[root] {Root}
% The first level, as children of the initial tree
child {node[level 2] (c1) {Child1}}
child {node[level 2] (c2) {Child2}}
child {node[level 2] (c3) {Child3}}
child {node[level 2] (c4) {Child4}};
% The second level, relatively positioned nodes
\begin{scope}[every node/.style={level 3}]
\node [below=10pt of c1, xshift=15pt] (c11) {A1};
\node [below=10pt of c11] (c12) {A2};
\node [below=10pt of c12] (c13) {A3};
\node [below=10pt of c2, xshift=15pt] (c21) {B1};
\node [below=10pt of c21] (c22) {B2};
\node [below=10pt of c22] (c23) {B3};
\node [below=10pt of c23] (c24) {B4};
\node [below=10pt of c3, xshift=15pt] (c31) {C1};
\node [below=10pt of c31] (c32) {C2};
\node [below=10pt of c32] (c33) {C3};
\node [below=10pt of c4, xshift=15pt] (c41) {D1};
\node [below=10pt of c41] (c42) {D2};
\end{scope}
% lines from each level 1 node to every one of its "children"
\foreach \value in {1,2,3}
\draw[->] (c1.195) |- (c1\value.west);
\foreach \value in {1,...,4}
\draw[->] (c2.195) |- (c2\value.west);
\foreach \value in {1,2,3}
\draw[->] (c3.195) |- (c3\value.west);
\foreach \value in {1,2}
\draw[->] (c4.195) |- (c4\value.west);
\end{tikzpicture}
\caption{Breakdown}
\end{figure}
\end{center}
\end{document} [/code]