So I can do this:
That is, its easy to add text alongside the connectors (either slanting alongside them or straight), but I would like part of the connector to be flat with the caption text along the flat part for better readability.
I thought perhaps I could do this by creating a fake node that would be just a line with text above it. Not sure how to implement that or if there is an easier way.
Thanks for any ideas?
Code for first figure:
\documentclass{article}
\usepackage{tikz}
\begin{document}
\tikzstyle{decision} = [rectangle, minimum height=18pt, minimum width=18pt, draw=blue, fill=none, ultra thick, inner sep=0pt]
\tikzstyle{chance} = [circle, minimum width=18pt, draw=blue, fill=none, ultra thick, inner sep=0pt]
\tikzstyle{line} = [draw=none]
\tikzset{
grow=right,
sloped,
join=miter,
level 1/.style={sibling distance=5cm,level distance=5.2cm},
level 2/.style={sibling distance=4cm, level distance=6.7cm},
level 3/.style={sibling distance=3cm, level distance=6.7cm},
edge from parent/.style={ultra thick, draw=blue},
edge from parent path={(\tikzparentnode.east) -- (\tikzchildnode.west)},
every node/.style={text ragged, inner sep=1mm}
}
\begin{tikzpicture}[]
\small
\node[decision]{}
child{node[line]{}
edge from parent
node[above]{Option 2}
}
child{node[chance]{}
child{node[line]{}}
child{node[line]{}}
edge from parent
node[below]{Option 1}
};
\end{tikzpicture}
\end{document}