0

I have been trying for ages without and prevail to design this diagram. It is my first time trying to use this package. Could someone help me please with this? Thanks :)

This is what I have so far:

\begin{singlespace}

\begin{tikzpicture}[
level 1/.style={sibling distance=50mm},
edge from parent/.style={->,draw},
>=latex]

% root of the the initial tree, level 1
\node[root] {VC: Global Showcase Event}
% The first level, as children of the initial tree
child {node[level 2] (c1) {Project Managment}}
child {node[level 2] (c2) {Ambassadors}}
child {node[level 2] (c3) {Marketing}};

% The second level, relatively positioned nodes
\begin{scope}[every node/.style={level 3}]
\node [below of = c1, xshift=15pt] (c11) {Project Assigned};
\node [below of = c11] (c12) {Project Start};
\node [below of = c12] (c13) {Plan Created};

\node [below of = c2, xshift=15pt] (c21) {Using a Matrix};
\node [below of = c21] (c22) {Create Ambassadors Requriements};
\node [below of = c22] (c23) {Contact Possible Ambassadors};
\node [below of = c23] (c24) {Comm Devlopments};

\node [below of = c3, xshift=15pt] (c31) {Default arrows};
\node [below of = c31] (c32) {Set Marketing Objectives};
\node [below of = c32] (c33) {Design Survey};
\node [below of = c33] (c34) {Publish Questionaire};
\node [below of = c34] (c35) {Evlauate Results};
\node [below of = c35] (c36) {Design Communication Plan};
\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,...,5}
\draw[->] (c3.195) |- (c3\value.west);
\end{tikzpicture}


\end{singlespace}

enter image description here

  • 1
    What have you got so far? The diagram is pretty large and it's unlikely somebody will go to the effort of recreating it for you, if you can share code to show efforts so far you might stand more chance of getting an answer. Or if there's a specific part of the diagram you're struggling on, ask about that specifically rather than pointing to a diagram. TikZ has pretty detailed documentation, although it's quite dense, it's worth a look as it may have useful examples. You may like to take a look at the Forest and tikz-qtree packages which are designed specifically to draw trees with Tikz. – Dai Bowen Nov 06 '16 at 23:23
  • 1
    There are plenty of similar diagrams on the site to use as examples to get started. Also, the diagram is not very pretty. Why are the branches at different levels and funny angles? Why are there 4 colours but only 3 levels and why is almost everything in level 3? – cfr Nov 06 '16 at 23:41
  • @DaiBowen See post update with the code now. – Matthew Wilson Nov 07 '16 at 01:02
  • Also, what exactly is the problem you've run into? Could you be a bit more specific about what you need help with? – cfr Nov 07 '16 at 01:04
  • I have no idea how to complete your code to make it compile. How is root defined? How is level 2 defined? – cfr Nov 07 '16 at 01:57

1 Answers1

3

It is a tree, so naturally, I recommend Forest ....

Loading the edges library provides access to the folder style which typesets a directory-style tree. Although that's not what the image you posted shows, that is what I took you to be trying to do with the code you posted. (Though I'm not confident of this at all.)

The nice thing about Forest is that all the locating of nodes is done automatically and, in this case, we colour the tree automatically according to level as well.

Omit the shadows for less bling.

\documentclass[tikz,border=10pt]{standalone}
\usepackage[edges]{forest}
\usetikzlibrary{arrows.meta,shadows.blur}
\begin{document}
\colorlet{myyellow}{yellow!50}
\begin{forest}
  colour me/.style={top color=#1!75, bottom color=#1, draw=#1, thick, blur shadow, rounded corners},
  for tree={
    edge=-Latex,
    font=\sffamily,
  },
  where level=1{
    for tree={
      folder,
      grow'=0,
    },
    edge path'={(!u.parent anchor) -- ++(0,-15pt) -| (.child anchor)},
  }{},
  before typesetting nodes={
    for tree={
      content/.wrap value={\strut #1},
    },
    if={isodd(n_children("!r"))}{
      for nodewalk/.wrap pgfmath arg={{fake=r,n=#1}{calign with current edge}}{int((n_children("!r")+1)/2)},
    }{},
    tempcounta/.max={level}{tree},
    for tree={
      colour me/.wrap pgfmath arg={cyan!#1!myyellow}{100*((tempcounta)-level())/(tempcounta)}
    }
  }
  [VC: Global Showcase Event
    [Project Management
      [Project Assigned]
      [Project Start]
      [Plan Created]
    ]
    [Ambassadors
      [Using a Matrix]
      [Create Ambassadors Requirements]
      [Contact Possible Ambassadors]
      [Comm Developments]
    ]
    [Marketing
      [Default arrows]
      [Set Marketing Objectives]
      [Design Survey]
      [Publish Questionnaire]
      [Evaluate Results]
      [Design Communication Plan, no edge, colour me=yellow]
    ]
  ]
\end{forest}
\end{document}

Forest solution

cfr
  • 198,882