2

I want create in latex an image like this (generated by ppt)enter image description here

For now I'm able to generate only the box in blue and green using this code

\documentclass[border=10pt]{standalone}
\usepackage{tikz}
\usetikzlibrary{calc,shapes.arrows}
\usetikzlibrary{automata} % LATEX and plain TEX
\usetikzlibrary{arrows,decorations.pathmorphing,backgrounds, chains,positioning,fit,petri,matrix,shapes.arrows,shadows,backgrounds}

\usetikzlibrary{mindmap}



\usetikzlibrary{shapes,arrows,fit,calc,shadings,graphs}
\tikzset{box/.style={draw, rectangle, rounded corners, thick,node distance=7em, text width=6em, text centered , inimum height=3.5em}}
\tikzset{container/.style={draw, rectangle , dashed, inner sep=2em}}
\tikzset{line/.style={draw, thick, -latex '}}


%Disegno per i grafici TikZ
\definecolor{bluei}{RGB}{83,116,191}
\definecolor{blueii}{RGB}{207,212,232}
\definecolor{greeni}{RGB}{135,200,81}
\definecolor{greenii}{RGB}{216,235,207}

\tikzset{
  myiblock/.style 2 args={
    draw=white,
    fill=#1,
    line width=1pt,
    rounded corners,
    minimum height=1cm,
    align=center,
    text=white,
    font=\sffamily,
    text width=#2
  },
  myoblock/.style={
    fill=#1,
    rounded corners,
    align=center,
    inner xsep=10pt
  }
}

\begin{document}


%1chain

\begin{tikzpicture}[node distance=3pt and 1cm]
\node[myiblock={bluei}{2cm}]
  (info1)
  {Id1 long 7 chars};
\node[myiblock={bluei}{2cm},below=of info1]
  (info2)
  {Id2 long 7 chars};
 \node[myiblock={bluei}{2cm},below=of info2]
  (info3)
  {Id3 long 7 chars};
  \node[myiblock={bluei}{2cm},below=of info3]
  (info4)
  {Id4 long 7 chars};
    \node[myiblock={bluei}{2cm},below=of info4]
  (info5)
  {Id5 long 7 chars};
    \node[myiblock={bluei}{2cm},below=of info5]
  (info6)
  {Id6 long 7 chars};
    \node[myiblock={bluei}{2cm},below=of info6]
  (info7)
  {Id7 long 7 chars};


\begin{pgfonlayer}{background}

\end{pgfonlayer}

%2 chain

\begin{scope}[xshift=6cm,node distance=3pt and 1cm]
\node[myiblock={greeni}{4cm}]
  (infoob1)
  {Text1 long 34 chars};
\node[myiblock={greeni}{4cm},below=of infoob1]
  (infoob2)
  {Text2 long 34 chars};
\node[myiblock={greeni}{4cm},below=of infoob2]
  (infoob3)
  {Text3 long 34 chars};
 \node[myiblock={greeni}{4cm},below=of infoob3]
  (infoob4)
  {Text4 long 34 chars};
  \node[myiblock={greeni}{4cm},below=of infoob4]
  (infoob5)
  {Text5 long 34 chars};
  \node[myiblock={greeni}{4cm},below=of infoob5]
  (infoob6)
  {Text6 long 34 chars};
  \node[myiblock={greeni}{4cm},below=of infoob6]
  (infoob7)
  {Text7 long 34 chars};
\begin{pgfonlayer}{background}
\end{pgfonlayer}
\end{scope}
\end{tikzpicture}

%3 chain

\begin{tikzpicture}[node distance=3pt and 1cm]
\node[myiblock={bluei}{2cm}]
  (info1)
  {Label1 long 20 chars};
\node[myiblock={bluei}{2cm},below=of info1]
  (info2)
  {Label2 long 20 chars};
 \node[myiblock={bluei}{2cm},below=of info2]
  (info3)
  {Label3 long 20 chars};
  \node[myiblock={bluei}{2cm},below=of info3]
  (info4)
  {Label4 long 20 chars};
    \node[myiblock={bluei}{2cm},below=of info4]
  (info5)
  {Label5 long 20 chars};
    \node[myiblock={bluei}{2cm},below=of info5]
  (info6)
  {Label6 long 20 chars};
    \node[myiblock={bluei}{2cm},below=of info6]
  (info7)
  {Label7 long 20 chars};


\begin{pgfonlayer}{background}

\end{pgfonlayer}
\end{tikzpicture}

\end{document}

My questions are: 1. how i can add the other box 2. how to add the ...between the box (see the first chain) 3. how to keep the same box size of the original image?

Thanks in advanced

1

See, if this is what you looking for:

     \documentclass[border=10pt,tikz]{standalone}
\usetikzlibrary{arrows.meta,
                calc, chains,
                decorations.pathreplacing,
                positioning}

%Disegno per i grafici TikZ
\definecolor{bluei}{RGB}{83,116,191}
\definecolor{greeni}{RGB}{135,200,81}

    \begin{document}
\begin{tikzpicture}[
  node distance = 6mm and 66mm,
    start chain = going below,
    auto,
iblock/.style = {draw=none,
                 fill=bluei,
                 rounded corners,
                 minimum height=1cm,
                 align=center,
                 text width=#1,
                 text=white, font=\sffamily,
                 inner xsep=10pt,
                 on chain},
oblock/.style = {draw=none,
                 fill=greeni,
                 rounded corners,
                 inner xsep=10pt, outer sep=1mm,
                 text width=40mm},
  line/.style = {draw=bluei, line width=1mm,
                 shorten >=1mm, shorten <=1mm,
                 -{Triangle[fill=bluei]}}
                    ]
%1chain
\node[iblock=1.2cm] (info11) {Id1 long 7 chars};
\node[iblock=1.2cm,below=2mm of info11] (info12) {Id2 long 7 chars};
\node[iblock=1.2cm] (info13) {Id3 long 7 chars};
\node[iblock=1.2cm,below=2mm of info13] (info14) {Id4 long 7 chars};
\node[iblock=1.2cm] (info15) {Id5 long 7 chars};
\node[iblock=1.2cm] (info16) {Id6 long 7 chars};
\node[iblock=1.2cm] (info17) {Id7 long 7 chars};
%2 chain
\node[iblock=34mm,right=of info11]
                    (info21) {Text1 long 34 chars};
\node[iblock=34mm,below=2mm of info21] (info22) {Text2 long 34 chars};
\node[iblock=34mm] (info23) {Text3 long 34 chars};
\node[iblock=34mm,below=2mm of info23] (info24) {Text4 long 34 chars};
\node[iblock=34mm] (info25) {Text5 long 34 chars};
\node[iblock=34mm] (info26) {Text6 long 34 chars};
\node[iblock=34mm] (info27) {Text7 long 34 chars};
%
\path[line,densely dotted,-](info12) edge (info13)
                            (info14) edge (info15)
                            (info15) edge (info16)
                            (info16) edge (info17);
%3 chain (lines with labels)
\path[line] (info11) edge node[oblock] {Label 1 long 20 chars} (info21)
            (info12) edge node[oblock] {Label 2 long 20 chars} (info22)
            (info13) edge node[oblock] {Label 3 long 20 chars} (info23)
            (info14) edge node[oblock] {Label 4 long 20 chars} (info24)
            (info15) edge node[oblock] {Label 5 long 20 chars} (info25)
            (info16) edge node[oblock] {Label 6 long 20 chars} (info26)
            (info17) edge node[oblock] {Label 7 long 20 chars} (info27);
% title and arrow
\node[oblock, text width=77mm, minimum height=9mm, align=center,
      above right=7mm and -11mm of info11.north west]
            (title) {Title};
\draw[line, line width=3mm, 
     -{Triangle[fill=bluei,length=3mm,width=6mm]}]
    (title.south -| info11) -- (info11.north);
% comment 1
\node[draw,minimum width=77mm,above=2mm of title] {Comment 1};
% comment 2
\draw[decorate, decoration={brace,raise=1mm,amplitude=2mm},draw=bluei,thick]
    (info21.north west) to node[above=5mm,
                                draw,black,thin,
                                minimum width=42mm,
                                align=left] {Comment 2\\ some more text} (info21.north east);
% comment 3
\draw[decorate, decoration={brace,raise=1mm,amplitude=2mm},draw=bluei,thick]
    (info17.south west) to node[left=5mm,
                                draw,black,thin,
                                text width=19mm,
                                align=left] {Comment 3\\ some more text} (info11.north west);
% comment 4
\path   let \p1 = (info17.west),
            \p2 = (info27.east),
            \n1 = {veclen(\x2-\x1,\y2-\y1)} in

        node[draw,minimum width=\n1,align=left,
             below right=5mm and 0mm of info17.south west] 
        {Comment 4\\ some more text};
\end{tikzpicture}
    \end{document}

This MWE gives:

enter image description here

In comparison with your code I made the following changes:

  • I merged your three tikz pictures in one.
  • For placing of blue nodes I use chain TikZ library. By it the code is significantly simplified. To use it, I add in picture option start chain=going below and in style for blue boxes (I rename it in iblock) add option on chain.
  • For curly braces I use TikZ library decorations.pathreplacing. Their use is in code after % comment 2 and % comment 3 in above MWE
  • For arrows I (re)define style line. If you not liked that lines are shortened, just erase shorten > and shorten <.
  • The green boxes are placed by arrows connecting left and right column of blue boxes.
  • The boxes for title and comment 1 are placed in respect to top left blue boxes (named info11)
  • The position of boxes for comment 2 and comment 3 is determined by curly braces

If you need some more information, how the code/picture is composed or have some questions about them, let me know.

Edit:

  • Add arrow is simple, so, if you learn something from provided code, you should do this yourself. Anyway, for it positioning I determine one its coordinate by intersection of (invisible) vertical line through center info11 node and horizontal line through south of title node: (title.south -| info11). The arrow is based on line style with local changed line width and arrow head length and width.

  • For the box for comment 4 is the same situation as at arrow ... however, I use for determining its size more complex route. For its width I first measure distance between west border of the nodes info17 ans east border of info12 column. For this is employed tikz library calc with function veclen and let

  • Vertical dotted line I grouped nodes in chain. First I increase vertical distance between them and than interrupt chain with explicit distance between nodes, where this lines not appear. Dotted lines is based in style line with local change of solid line to dotted, and with option - eliminated arrow head.

That is. I hope that given explanation as well provided code will help you toin learn of us TikZ. Of course, you need to read TikZ manual (at least part III and section about used libraries), see examples here and for example in TeXexample etc.

enter image description here

| improve this answer | |
  • Thanks Zarko, can you explain me as: 1) I can add the arrow between "Title" and "Id1 long 7char"; 2) how add the box for comment 4, 3) how add the ...between "id2 long 7char" and "id3 long 7char" – Marta Dec 8 '15 at 9:35
  • @Marta, see upgraded answer. – Zarko Dec 8 '15 at 13:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.