How can I put text inside the bar instead of over the bar? Thank you in advance for your help!



\startchronology[align=left, startyear=1790,stopyear=1860, height=0pt, startdate=false, stopdate=false, dateselevation=0pt, arrow=false, box=true]
\chronoperiode[textstyle=\raggedleft\colorbox{green}, color=green, startdate=false, bottomdepth=0pt, topheight=8pt, textdepth=-15pt,dateselevation=16pt, stopdate=false]{1790}{1860}{Text}
\chronoperiode[textstyle=\colorbox{blue}, color=blue, startdate=false, bottomdepth=8pt, topheight=16pt, textdepth=-20pt, dateselevation=12pt, stopdate=false]{1850}{1860}{More text}

  • 1
    Welcome to TeX.sx! Please add not a chunk of code but a minimal working example (MWE) that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass{...} and ending with \end{document}.
    – Fran
    Aug 31, 2020 at 21:04
  • @CecilieV -- please see if the answer suits your requirement
    – js bibra
    Sep 1, 2020 at 13:41

1 Answer 1


With help from --




I found it easier with just TiKz

enter image description here

enter image description here


\subsection*{Biographical cornerstones}
    node distance = 0mm,
      L/.style = {% as Line style for the gray base line with length 10 units 
    line width=1.5mm,
    {Bar[width=22mm,line width=1pt]}-{Bar[width=22mm,line width=1pt]}% for the corner 
\draw[L]    ( 0,0)  coordinate (s)% draw the base bar of gray color
                    node[above=10mm] {1790} --  
            (10,0)  node[above=10mm] {1860};
\draw[green!40,line width=4.5mm]    %draw the next bar of green color
            ( 0.03,0.3)  coordinate (t)--
            node[pos=0.5,black] {Some text}
            (9.97,0.3) ;

\draw[blue!40,line width=4.5mm]    % draw the blue bar
            ( 6*1.43,0.72)  coordinate (r)--         % 7portions of the base bar is 
                                                      %1.43 units each i.e 10/7
            node[pos=0.5,black,font=\tiny,align=center] {More \\text}
            (9.97,0.72) ;

\foreach \x in {1,...,6}{%
        \pgfmathsetmacro\result{1790+(\x * 10)}    % macro to calculate labels
\draw[gray,line width=1pt]                        %draw the ticks for each year


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.