0

I want to draw multiple sequence diagrams with in and append some explanatory text.

enter image description here

Here is my minimum working example code:

\documentclass{article}

\usepackage[a4paper, landscape, margin=2in]{geometry}
\usepackage[rgb]{xcolor}
\usepackage{tikz}
\usepackage{smartdiagram}
\usesmartdiagramlibrary{additions}

\definecolorseries{colours}{hsb}{grad}[hsb]{.575,1,1}{.987,-.234,0}
\resetcolorseries[12]{colours}

\begin{document}

\centering
\smartdiagramset{
    set color list={red!10, red!30,red!50},
    sequence item border color=black,
    sequence item text color=black,
    sequence item border size=1.2\pgflinewidth,
    sequence item font size=\scriptsize\sffamily,
    additions={
        additional item shape = rectangle,
        additional item fill color = colours!!+!20,
        additional item border color = colours!!,
        additional arrow line width = 2pt,
        additional arrow tip = to,
        additional arrow color = black,
        additional item font = \scriptsize\sffamily,
      }
}

\smartdiagramadd[sequence diagram]{A1, B1, C1, D1, E1, F1, G1, H1}
{
above of sequence-item1/Step 1,
above of sequence-item2/Step 2,
above of sequence-item3/Step 3,
above of sequence-item4/Step 4,
above of sequence-item5/Step 5,
above of sequence-item6/Step 6,
above of sequence-item7/Step 7,
above of sequence-item8/Step 8
}


\smartdiagramconnect{to-}{sequence-item1/additional-module1}
\smartdiagramconnect{to-}{sequence-item2/additional-module2}
\smartdiagramconnect{to-}{sequence-item3/additional-module3}
\smartdiagramconnect{to-}{sequence-item4/additional-module4}
\smartdiagramconnect{to-}{sequence-item5/additional-module5}
\smartdiagramconnect{to-}{sequence-item6/additional-module6}
\smartdiagramconnect{to-}{sequence-item7/additional-module7}
\smartdiagramconnect{to-}{sequence-item8/additional-module8}

\smartdiagram[sequence diagram]{A2, B2, C2, D2, E2, F2, G2, H2}

\smartdiagram[sequence diagram]{A3, B3, C3, D3, E3, F3, G3, H3}

\begin{tikzpicture}[overlay]
    \node[left = of module1, xshift = -90mm, yshift = 45mm] {C 1};
    \node[left = of module1, xshift = -90mm, yshift = 27mm] {C 2};
    \node[left = of module1, xshift = -90mm, yshift = 12mm] {C 3};
    
\end{tikzpicture}

\end{document}

Questions

  1. Space between first & second sequence diagrams and space between second & third sequence diagrams are not same.
  2. Increase the distance between first sequence diagram and explanatory text in boxes above it.
  3. Put text like C 1, C 2 and C 3 in boxes.
  4. How to change color of a single and multiple items for a specific sequence diagram only.
9
  • 4
    Well, as usual, what have you tried? Please show us the code!
    – Mensch
    Commented Apr 6, 2023 at 16:36
  • Does this answer your question? Project diagram with tikz
    – Sebastiano
    Commented Apr 6, 2023 at 19:28
  • @MYaseen208 Your code does not compile. Commented Apr 9, 2023 at 17:54
  • @samcarter_is_at_topanswers.xyz: I double checked it. It is compiling with some warnings.
    – MYaseen208
    Commented Apr 9, 2023 at 17:58
  • 1
    @MYaseen208 Your code still does not compile. The shapes you reference in your tikz picture don't exist, but anyway, here a solution which should tackle your points 1-3 pastebin.com/kJE0jekW For your 4th question: you already set a colour list with set color list, if you want to change the colour of one or more of the items, change them there. Commented Apr 9, 2023 at 18:18

2 Answers 2

3
  1. Space between first & second sequence diagrams and space between second & third sequence diagrams are not same.

Empty lines in latex denote a new paragraph. The more empty lines you add between your smartdiagrams, the bigger the space is going to be.

  1. Increase the distance between first sequence diagram and explanatory text in boxes above it.

You can change the spacing with additional item offset

  1. Put text like C 1, C 2 and C 3 in boxes.

You already put boxes above the diagram. You can use the same technique to put boxes in front of the diagram.

  1. How to change color of a single and multiple items for a specific sequence diagram only.

You are hard coding the list of colours in set color list. If you want to change one or more colours change them there.

\documentclass{article}

\usepackage[a4paper, landscape, margin=2in]{geometry}
\usepackage[rgb]{xcolor}
\usepackage{tikz}
\usepackage{smartdiagram}
\usesmartdiagramlibrary{additions}

\definecolorseries{colours}{hsb}{grad}[hsb]{.575,1,1}{.987,-.234,0}
\resetcolorseries[12]{colours}

\begin{document}

\centering
\smartdiagramset{
    set color list={red!10, red!30,red!50},
    sequence item border color=black,
    sequence item text color=black,
    sequence item border size=1.2\pgflinewidth,
    sequence item font size=\scriptsize\sffamily,
    additions={
        additional item shape = rectangle,
        additional item fill color = colours!!+!20,
        additional item border color = colours!!,
        additional arrow line width = 2pt,
        additional arrow tip = to,
        additional arrow color = black,
        additional item font = \scriptsize\sffamily,
        additional item offset = 1cm,
      }
}

\smartdiagramset{set color list={black!50, red!30,red!50}}
\smartdiagramadd[sequence diagram]{A1, B1, C1, D1, E1, F1, G1, H1}
{
above of sequence-item1/Step 1,
above of sequence-item2/Step 2,
above of sequence-item3/Step 3,
above of sequence-item4/Step 4,
above of sequence-item5/Step 5,
above of sequence-item6/Step 6,
above of sequence-item7/Step 7,
above of sequence-item8/Step 8,
left of sequence-item1/C1
}
\smartdiagramconnect{to-}{sequence-item1/additional-module1}
\smartdiagramconnect{to-}{sequence-item2/additional-module2}
\smartdiagramconnect{to-}{sequence-item3/additional-module3}
\smartdiagramconnect{to-}{sequence-item4/additional-module4}
\smartdiagramconnect{to-}{sequence-item5/additional-module5}
\smartdiagramconnect{to-}{sequence-item6/additional-module6}
\smartdiagramconnect{to-}{sequence-item7/additional-module7}
\smartdiagramconnect{to-}{sequence-item8/additional-module8}
\smartdiagramset{set color list={red!20, red!30,red!50,green!40,orange!40,black!50,black!50,black!50}}
\smartdiagramadd[sequence diagram]{A2, B2, C2, D2, E2, F2, G2, H2}{left of sequence-item1/C2}
\smartdiagramset{set color list={red!20, red!30,red!50,green!40,orange!40,yellow!40,magenta!40,brown!40}}
\smartdiagramadd[sequence diagram]{A3, B3, C3, D3, E3, F3, G3, H3}{left of sequence-item1/C3}


\end{document}

enter image description here

2
  • Thanks for very useful answer. Would highly appreciate it if you guide me how to use black color for first item of first sequence and last three items of second sequence.
    – MYaseen208
    Commented Apr 10, 2023 at 13:21
  • @MYaseen208 See above Commented Apr 10, 2023 at 13:26
5
\documentclass[a4paper,12pt]{article}
\usepackage{smartdiagram}
\usepackage{geometry}


\begin{document}
\begin{center}
\smartdiagram[sequence diagram]{Adgg,Bdgg,Cdgdg,Dgdg,Effdf,Fhgh}
\end{center}
\end{document}

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .