My problem is quite simple, yet i can't find answer. Pre:
\usepackage{tikz}
\usetikzlibrary{matrix, shapes, arrows, positioning, fit, calc}
Styles:
\tikzstyle{decision} = [diamond, draw, fill=blue!20,
text width=6em, text badly centered, node distance=3cm, inner sep=0pt]
\tikzstyle{block} = [rectangle, draw, fill=blue!20, text width=9em, text centered, rounded corners, minimum height=2.5em]
\tikzstyle{label} = [draw=white!0, minimum size=2ems]
\tikzstyle{line} = [draw, -latex']
\tikzstyle{cloud} = [draw, ellipse,fill=red!20, node distance=3cm,
minimum height=2em]
\tikzstyle{box}=[rectangle,
thick,
minimum size=1cm,
draw=black!80,
fill=gray!01]
\tikzstyle{connector} = [->,thick]
\tikzstyle{pusty}=[draw=white, minimum size=2em]
Im using myncbar macro to create C-like shapes:
\def\myarm{1cm}
\def\myangle{0}
\tikzset{
arm/.default=1cm,
arm/.code={\def\myarm{#1}}, % store value in \myarm
angle/.default=0,
angle/.code={\def\myangle{#1}} % store value in \myangle
}
\tikzset{
myncbar/.style = {to path={
% We need to calculate a couple of coordinates to help us draw
% the path.
let
% Same as (\tikztotarget)++(\myangle:\myarm)
\p1=($(\tikztotarget)+(\myangle:\myarm)$)
in
-- ++(\myangle:\myarm) coordinate (tmp)
% Find the projection of the (tmp) coordinate
% on the line from the target to p1
-- ($(\tikztotarget)!(tmp)!(\p1)$)
-- (\tikztotarget)\tikztonodes
}}
}
And my code is:
\begin{figure}[H]
\begin{center}
\begin{tikzpicture}[node distance = 2cm, auto]
% Place nodes
\node [decision] (init) {Minął określony czas?};
\node [block, below of=init, node distance = 3cm] (oblicz) {Oblicz różnicę temperatur};
\node [decision, below of=oblicz, node distance=3.5cm] (roznica) {Róznica powyżej zadanego poziomu?};
\node [decision, below of=roznica, node distance=5.5cm] (otwarte) {Przepustnice otwarte maksymalnie i temperatura spada?};
\node [block, right of=otwarte, node distance=5.5cm] (ostrzezenie) {Wyświetl ostrzeżenie o kończącym się paliwie};
\node [block, below of=otwarte, node distance=4cm] (kat) {Oblicz kąt otwarcia przepustnic};
\node [block, below of=kat, node distance=2cm] (servo) {Ustaw serwomechanizmy};
\node [block, below of=servo, node distance=2cm] (koniec) {Koniec};
% Draw edges
\path [line] (init) -- node [near start] {Tak} (oblicz);
\path [line] (init.west) to[myncbar,angle=0,arm=-2cm] node [near start] {Nie} (koniec.west);
\path [line] (oblicz) -- (roznica);
\path [line] (roznica) -- node [near start] {Tak} (otwarte);
\path [line] (roznica.east) to[myncbar,angle=0,arm=6cm] node [near start] {Nie} (koniec.east);
\path [line] (otwarte) -- node [near start] {Tak} (ostrzezenie);
\path [line] (otwarte) -- node [near start] {Nie} (kat);
\path [line] (kat) -- (servo);
\path [line] (servo) -- (koniec);
\path [line] (ostrzezenie) -- (koniec);
\end{tikzpicture}
\caption{Algorytm obsługi kotła}
\end{center}
\end{figure}
And my problem is in this line:
\path [line] (init.west) to[myncbar,angle=0,arm=-2cm] node [near start] {Nie} (koniec.west);
...
\path [line] (roznica.east) to[myncbar,angle=0,arm=6cm] node [near start] {Nie} (koniec.east);
Text labels are not near start. They are near the start of the last line. Is it possible to make them near start of the first line?
