I am trying to replicate the following flowchart
with the following code:
\documentclass[border=10pt]{standalone}
\usepackage{tikz}
\usetikzlibrary{shapes.geometric, arrows}
\tikzstyle{startstop} = [rectangle, minimum width=3cm, minimum height=1cm,text centered, draw=black, fill=red!30]
\tikzstyle{io} = [trapezium, trapezium left angle=70, trapezium right angle=110, minimum width=3cm, minimum height=1cm, text centered, draw=black, fill=blue!30]
\tikzstyle{process} = [rectangle, minimum width=3cm, minimum height=1cm, text centered, draw=black, fill=orange!30]
\tikzstyle{decision} = [diamond, minimum width=3cm, minimum height=1cm, text centered, draw=black, fill=green!30]
\tikzstyle{arrow} = [thick,->,>=stealth]
\begin{document}
\begin{tikzpicture}[node distance=2cm]
\node (start) [startstop] {Planning};
\node (in1) [startstop, below of=start] {Input};
\node (pro1) [process, below of=in1] {Process 1};
\node (pro2) [process, below of=pro1] {Decision 1};
\node (dec1) [decision, below of=pro2, yshift=-0.5cm] {Decision 1};
\node (dec2) [decision, below of=dec1, yshift=-1cm] {Decision 2};
\draw [arrow] (start) -- (in1);
\draw [arrow] (in1) -- (pro1);
\draw [arrow] (pro1) -- (pro2);
\draw [arrow] (pro2) -- (dec1);
\draw [arrow] (dec1) -- (dec2);
\end{tikzpicture}
\end{document}
However I am unable to setup the nodes to write in several lines, to draw a diamond make the proper connectors with the text "yes" or "no".
Should I use any other setup and configuration?
Thanks in advance for your help.
minimum width
definetext width
, or use manual way to breake text in more lines. for this you shol add to nedes optionsalign=...
(center, left, right, justfy). read chapter 17 Nodes and Edges of tikz & pgf manual v 3.0.3a, page 214