Reputation: 23
I need to draw the same flowchart as the following image but my problem is that I don't know how to draw the arrow from A-7 (diamond 1) to A-4. I tried using \drawlatex edge (A-4) and a few other solutions but nothing worked. Also I would like to know if can I improve my code .
\documentclass{article}
\usepackage[left=0.5cm,right=1.27cm,top=1.3cm,bottom=1.3cm]{geometry}
\usepackage[french]{babel}
\usepackage[T1]{fontenc}
% Required packages
\usepackage{tikz}
\usetikzlibrary{arrows.meta,
calc, chains,
decorations.pathreplacing,%
calligraphy,% had to be after decorations.pathreplacing
positioning,
shapes}
\definecolor{blue1}{RGB}{84,141,212}
\definecolor{blue2}{RGB}{142,180,227}
\definecolor{yellow1}{RGB}{255,229,153}
\definecolor{orange1}{RGB}{255,153,0}
\definecolor{gray1}{RGB}{127,127,127}
\definecolor{gray2}{RGB}{217,217,217}
\begin{document}
\begin{center}
\small
\begin{tikzpicture}[
node distance = 8mm and 12mm,
start chain = A going below,
arr/.style = {-{Triangle[length=3mm, width=6mm]}, line width= 2mm,
draw=blue2, shorten > = 1mm, shorten <=1mm},
BC/.style args = {#1/#2/#3}{
decorate,
decoration={calligraphic brace, amplitude=6pt,
pre =moveto, pre length=1pt,
post=moveto, post length=1pt,
raise=#1,
#2},% for mirroring of brace
very thick,
pen colour={#3} },
N/.style = {draw, semithick, rounded corners,
fill=#1,draw=blue2,
minimum height=10mm, text width=80mm,
align=flush center},
N1/.style = {draw, semithick, rounded corners,
fill=#1,
minimum height=10mm, text width=50mm,
align=flush center},
N2/.style={draw,text width=3cm ,text centered,
minimum width=4cm,fill=yellow1,tape, tape bend top=none,tape bend height=1.1mm, tape bend bottom=in and out,
minimum height=1.1cm} ,
N3/.style = {diamond, minimum width=7.5cm, minimum height=4mm, text centered, draw=blue2, fill=blue2},
N4/.style = {rectangle, text width=4cm, minimum height=1cm, text centered ,fill=gray2}]
% main branch
\begin{scope}[nodes={on chain=A, join=by arr}]
\node [N1=blue1,draw=blue1] {ETAPES}; % A-1
\node [N=blue2] {Besoin en RH}; % A-2
\node [N=blue2] {Identification des compétences nécessaires};
\node [N=blue2] {Rédaction de l’offre d’emploi};
\node [N=blue2] { Pré-sélection des candidats};
\node [N=blue2] {Entretien « final »};
\node [N3=blue2] {Candidature validée?};
\node [N=blue2] { Préparation, signature et archivage des documents légaux};
\node [N=blue2] {Formation interne et enregistrement de la formation };
\node [N3=blue2] {Candidature validée?};
\node [N=blue2] {Prise de fonction};
\end{scope}
% nodes on the left side of the main branch
\node [N1=gray1,draw=gray1,
left=19 mm of A-1] (B-1) {ACTEURS};
\node [N4=gray2,draw=gray2,
left=of A-2] (B-2) {Collaborateur };
\node [N4=gray2,draw=gray2,
left=of A-3] (B-3) {Directeur et RQ\&AR };
\coordinate (aux1) at ($(A-4.south west)!0.5!(A-5.north west)$);
\draw[BC=4mm/mirror/gray2] (A-4.west) -- (A-5.west);
\node [N4=gray2,left=of aux1,draw=gray2 ] (B-4) { Agence Interim / Cabinet de recrutement };
\node [N4=gray2,draw=gray2,
left=of A-6] (B-4) {Directeur et RQ\&AR };
\node [N4=gray2,draw=gray2,
left=of A-8] (B-4) {Directeur et RQ\&AR };
\node [N4=gray2,draw=gray2,
left=of A-9] (B-4) {Directeur et RQ\&AR };
\node [N4=gray2,draw=gray2,
left=of A-11] (B-4) {Directeur et RQ\&AR };
% nodes on the right side of thr main branch
\begin{scope}[N/.append style={text width=44mm},
N/.default=yellow1]
\node[N1=yellow1,draw=yellow1, right=18mm of A-1] (C-1) {DOCUMENTS};
\node[N2,draw=yellow1, right=of A-9,text width=5.4cm ] (C-2) {FOR\_MATRICE\_COMPETENCES +
BDD\_DOCS\_RH };
\node[N2,draw=yellow1, right=of A-11] (C-3) {FOR\_FORMATION + BDD\_FORMATIONS};
\end{scope}
%arrows
\end{tikzpicture}
\end{center}
\end{document}
Upvotes: 2
Views: 3356
Reputation: 38783
You can use
\draw[red,ultra thick,-latex] (A-7.east) -- ++(1.5,0) |- (A-4) node[near start,anchor=west] {Non};
This first draws a short horizontal line from A-7
to the left and then the |-
connects it via vertical and horizontal lines to A-4
. Change the value of 1.5
to determine how far the arrow should stick out.
\documentclass{article}
\usepackage[left=0.5cm,right=1.27cm,top=1.3cm,bottom=1.3cm]{geometry}
\usepackage[french]{babel}
\usepackage[T1]{fontenc}
% Required packages
\usepackage{tikz}
\usetikzlibrary{arrows.meta,
calc, chains,
decorations.pathreplacing,%
calligraphy,% had to be after decorations.pathreplacing
positioning,
shapes}
\definecolor{blue1}{RGB}{84,141,212}
\definecolor{blue2}{RGB}{142,180,227}
\definecolor{yellow1}{RGB}{255,229,153}
\definecolor{orange1}{RGB}{255,153,0}
\definecolor{gray1}{RGB}{127,127,127}
\definecolor{gray2}{RGB}{217,217,217}
\begin{document}
\begin{center}
\small
\begin{tikzpicture}[
node distance = 8mm and 12mm,
start chain = A going below,
arr/.style = {-{Triangle[length=3mm, width=6mm]}, line width= 2mm,
draw=blue2, shorten > = 1mm, shorten <=1mm},
BC/.style args = {#1/#2/#3}{
decorate,
decoration={calligraphic brace, amplitude=6pt,
pre =moveto, pre length=1pt,
post=moveto, post length=1pt,
raise=#1,
#2},% for mirroring of brace
very thick,
pen colour={#3} },
N/.style = {draw, semithick, rounded corners,
fill=#1,draw=blue2,
minimum height=10mm, text width=80mm,
align=flush center},
N1/.style = {draw, semithick, rounded corners,
fill=#1,
minimum height=10mm, text width=50mm,
align=flush center},
N2/.style={draw,text width=3cm ,text centered,
minimum width=4cm,fill=yellow1,tape, tape bend top=none,tape bend height=1.1mm, tape bend bottom=in and out,
minimum height=1.1cm} ,
N3/.style = {diamond, minimum width=7.5cm, minimum height=4mm, text centered, draw=blue2, fill=blue2},
N4/.style = {rectangle, text width=4cm, minimum height=1cm, text centered ,fill=gray2}]
% main branch
\begin{scope}[nodes={on chain=A, join=by arr}]
\node [N1=blue1,draw=blue1] {ETAPES}; % A-1
\node [N=blue2] {Besoin en RH}; % A-2
\node [N=blue2] {Identification des compétences nécessaires};
\node [N=blue2] {Rédaction de l’offre d’emploi};
\node [N=blue2] { Pré-sélection des candidats};
\node [N=blue2] {Entretien « final »};
\node [N3=blue2] {Candidature validée?};
\node [N=blue2] { Préparation, signature et archivage des documents légaux};
\node [N=blue2] {Formation interne et enregistrement de la formation };
\node [N3=blue2] {Candidature validée?};
\node [N=blue2] {Prise de fonction};
\end{scope}
% nodes on the left side of the main branch
\node [N1=gray1,draw=gray1,
left=19 mm of A-1] (B-1) {ACTEURS};
\node [N4=gray2,draw=gray2,
left=of A-2] (B-2) {Collaborateur };
\node [N4=gray2,draw=gray2,
left=of A-3] (B-3) {Directeur et RQ\&AR };
\coordinate (aux1) at ($(A-4.south west)!0.5!(A-5.north west)$);
\draw[BC=4mm/mirror/gray2] (A-4.west) -- (A-5.west);
\node [N4=gray2,left=of aux1,draw=gray2 ] (B-4) { Agence Interim / Cabinet de recrutement };
\node [N4=gray2,draw=gray2,
left=of A-6] (B-4) {Directeur et RQ\&AR };
\node [N4=gray2,draw=gray2,
left=of A-8] (B-4) {Directeur et RQ\&AR };
\node [N4=gray2,draw=gray2,
left=of A-9] (B-4) {Directeur et RQ\&AR };
\node [N4=gray2,draw=gray2,
left=of A-11] (B-4) {Directeur et RQ\&AR };
% nodes on the right side of thr main branch
\begin{scope}[N/.append style={text width=44mm},
N/.default=yellow1]
\node[N1=yellow1,draw=yellow1, right=18mm of A-1] (C-1) {DOCUMENTS};
\node[N2,draw=yellow1, right=of A-9,text width=5.4cm ] (C-2) {FOR\_MATRICE\_COMPETENCES +
BDD\_DOCS\_RH };
\node[N2,draw=yellow1, right=of A-11] (C-3) {FOR\_FORMATION + BDD\_FORMATIONS};
\end{scope}
%arrows
\draw[red,ultra thick,-latex] (A-7.east) -- ++(1.5,0) |- (A-4) node[near start,anchor=west] {Non};
\end{tikzpicture}
\end{center}
\end{document}
Upvotes: 3