我有一个问题。我不知道如何让三角形的顶线变成虚线。我已经尝试过额外画线,但这样角落就不干净了。
这是我的代码:
\documentclass[border=5mm]{standalone}
\usepackage{tikz}
\usetikzlibrary{positioning}
\definecolor{tu}{RGB}{36,53,114}
\begin{document}
\begin{tikzpicture}[node distance=2cm]
\draw[line width=0.5mm, color=tu, fill=tu!40] (0,-4) -- node[sloped,below,color=black,font=\scriptsize] {Benutzeroberfläche}(3.5,2)
--node[sloped,above,color=black,font=\scriptsize,name=top]{transparentes Big-Data-Backend} (-3.5,2) -- node[sloped,below,color=black,font=\scriptsize] {Benutzeroberfläche} (0,-4) -- cycle;
%\draw[line width=0.5mm, color=tu, loosely dashed,] (3.5,2) -- node[sloped,above,color=black,font=\scriptsize,name=top]{transparentes Big-Data-Backend} (-3.5,2);
\node[name=center,align=center,text=white ]{\textbf{dreiseitige}\\\textbf{Koordinations-}\\\textbf{plattform}};
\node [right=of center, align=center, name=right, font=\footnotesize] {\textbf{Nachfrage}\\(Auftraggeber)};
\node [left=of center, align=center,name=left, font=\footnotesize] {\textbf{Angebot}\\(Auftragnehmer)};
\node [above=0 of top, name=above, font=\footnotesize] {\textbf{Plattformbetreiber}};
\end{tikzpicture}
\end{document}
感谢您的帮助!
答案1
这里有一个建议:line cap=round
并选择dash pattern
使得开始和结束为on
。
\documentclass[border=5mm]{standalone}
\usepackage{tikz}
\usetikzlibrary{positioning}
\definecolor{tu}{RGB}{0,53,128}
\begin{document}
\begin{tikzpicture}[node distance=2cm]
\fill[tu!40] (0,-4) -- node[sloped,below,color=black,font=\scriptsize] {Benutzeroberfläche}(3.5,2)
--node[sloped,above,color=black,font=\scriptsize,name=top]{transparentes Big-Data-Backend} (-3.5,2) -- node[sloped,below,color=black,font=\scriptsize] {Benutzeroberfläche} (0,-4) -- cycle;
\draw[line width=0.5mm, color=tu,line cap=round] (-3.5,2) -- (0,-4) -- (3.5,2);
\draw[line width=0.5mm, color=tu,dash pattern=on 0.7mm off 0.61mm,line cap=round] (-3.5,2) -- (3.5,2);
%\draw[line width=0.5mm, color=tu, loosely dashed,] (3.5,2) -- node[sloped,above,color=black,font=\scriptsize,name=top]{transparentes Big-Data-Backend} (-3.5,2);
\node[name=center,align=center,text=white ]{\textbf{dreiseitige}\\\textbf{Koordinations-}\\\textbf{plattform}};
\node [right=of center, align=center, name=right, font=\footnotesize] {\textbf{Nachfrage}\\(Auftraggeber)};
\node [left=of center, align=center,name=left, font=\footnotesize] {\textbf{Angebot}\\(Auftragnehmer)};
\node [above=0 of top, name=above, font=\footnotesize] {\textbf{Plattformbetreiber}};
\end{tikzpicture}
\end{document}
如果你想要常规破折号:
\documentclass[border=5mm]{standalone}
\usepackage{tikz}
\usetikzlibrary{positioning,arrows.meta}
\definecolor{tu}{RGB}{36,53,114}
\begin{document}
\begin{tikzpicture}[node distance=2cm]
\fill[tu!40] (0,-4) -- node[sloped,below,color=black,font=\scriptsize] {Benutzeroberfläche}(3.5,2)
--node[sloped,above,color=black,font=\scriptsize,name=top]{transparentes Big-Data-Backend} (-3.5,2) -- node[sloped,below,color=black,font=\scriptsize] {Benutzeroberfläche} (0,-4) -- cycle;
\draw[line width=0.5mm, color=tu,line cap=round] (-3.5,2) -- (0,-4) -- (3.5,2);
\draw[line width=0.5mm, color=tu,dash pattern=on 3pt off 2.1pt,
Round Cap-Round Cap] (-3.5,2) -- (3.5,2);
%\draw[line width=0.5mm, color=tu, loosely dashed,] (3.5,2) -- node[sloped,above,color=black,font=\scriptsize,name=top]{transparentes Big-Data-Backend} (-3.5,2);
\node[name=center,align=center,text=white ]{\textbf{dreiseitige}\\\textbf{Koordinations-}\\\textbf{plattform}};
\node [right=of center, align=center, name=right, font=\footnotesize] {\textbf{Nachfrage}\\(Auftraggeber)};
\node [left=of center, align=center,name=left, font=\footnotesize] {\textbf{Angebot}\\(Auftragnehmer)};
\node [above=0 of top, name=above, font=\footnotesize] {\textbf{Plattformbetreiber}};
\end{tikzpicture}
\end{document}