as starting point ...
\documentclass[tikz, margin=5pt]{standalone}
\usetikzlibrary{arrows.meta}
\begin{document}
\begin{tikzpicture}[
TL/.style = {very thick, Bar[width=4mm]},% as Time Line :-)
tbox/.style = {font=\Large\bfseries\sffamily},
bbox/.style = {text width=4cm, align=left, inner sep=2mm}
]
\draw[TL] (-5,0) -- (5,0);
\draw[TL,densely dashed] (0,2mm) -- (0,-2mm);
%
\node [tbox,above] at (-2.4,0) {DAY (DM)};
\node [tbox,above] at ( 2.4,0) {NIGHT (CM)};
%
\node [bbox,below right] at (-5,0) {xx xx xx xxx xxx xxx xxx\\
yy yy yyy yyy yyyy\\
zzzzz zz zzzz z z zzz};
\node [bbox,below right] at (0,0) {xx xx xx xxx xxx xxx xxx\\
yy yy yyy yyy yyyy\\
zzzzz zz zzzz z z zzz};
\end{tikzpicture}
\end{document}
Edit: instead of >={Bar[width=4mm]}
is defined new style for vectors: Vect/.style = {very thick, Bar[width=4mm]}
and accordingly changed code for line.
You can use |-
and -|
to draw lines with right angles in them so, for example
\draw[latex'-latex',thick] (4.west) -| node [left] {Account funding} (5);
will fix your funding arrow. In addition, I have tried to make the edges for (6)
and (7)
parallel, I have fixed the end-points for arrow (1)
and I have moved the arrows for (1)
and (2)
down a little using yshift=-7mm
as I think this looks much nicer:
Here's the full code:
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{positioning}
\usetikzlibrary{arrows}
\begin{document}
\begin{tikzpicture}
\tikzstyle{box}=[draw,text width=8em, minimum height=7.5em,thin, align=flush center]
% The comment style
\tikzstyle{comment}=[rectangle, inner sep= 5pt, text width=4cm, node distance=0.25cm]
\tikzstyle{box1}=[draw,text width=11em, minimum height=3.5em,thin,align=flush center]
\tikzstyle{line}=[draw, thick, -latex']
\node (1) [box] {\textbf{Customer}};
\node (2) [box,right=30mm of 1] {\textbf{Merchant}};
\node (3) [box1] at (3.5,-3) {\textbf{Intermediation Server}};
\node (4) [box1] at (3.5,-5) {\textbf{Netbill's Bank}};
\node (5) [box] at (0.5,-8) {\textbf{Customer's Bank}};
\node (6) [box] at (6.5,-8) {\textbf{Merchant's Bank}};
\node [comment, text width=3cm] at (1.5,-10.7) { 1. Request quote\\
2. Present quote\\
3. Accept quote\\
4. Deliver goods };
\node [comment, text width=4cm] at (5.5,-10.9) { 5. Send electronic payement order (EPO)\\
6. Send EPO and key\\
7. Send receipt\\
8. Send receipt };
%arrows
\draw [-latex,thick] ([yshift=-7mm]1.north east) -- node[right,above] {(1)}([yshift=-7mm]2.north west) ;
\draw [-latex,thick] ([yshift=-7mm]2.west) -- node[left,above] {(2)}([yshift=-7mm]1.east) ;
\draw [-latex,thick] (2.south west) -- node[left] {(6)}([xshift=5mm]3.north) ;
\draw [-latex,thick] (3.north east) -- node[right] {(7)}(2.south) ;
\draw[latex'-latex',thick] (3) -- (4);
\draw[latex'-latex',thick] (4.west) -| node [left] {Account funding} (5);
\draw [-latex,thick] (4) |- node[left,below] {Batch payment}(6) ;
\end{tikzpicture}
\end{document}
You can adapt how I moved arrows(1)
and (2)
if you want more arrows between the "Customer" and Merchant"
By default you can use A.north
, A.east
, A.south
, A.west
, A.north east
, ..., A.south west
to position the end points of edges to and from node A
. You can also use
\draw(A) to[out=70, in=110] (B);
to control the exit and entry angles for curved arrows. If you need more control over the placement of the arrows have a look at the positioning library
-- see section 17.5.3 of the current tikz/pgf manual (page 229).
Best Answer
Since you seem to be waiting for a
tikz-cd
-solution (Thanks to Bernard for typing all the formulae from your drawing):If you want to rotate the number 5 to the same angle of the arrow, you may write
\arrow{dr}[swap,sloped]{5}
.Edit:
For your second picture: