3

I have a grid of tcolorbox cells and i want to have a first vertical and horizontal bar with labels in the same style. I have managed to edit some examples from online, but am currently stuck on how to make my vertical title blocks look exactly the same as the horizontal ones.

I have tried stuff like resizebox already, but it did not work as expected. I don't really find anything online already discussing vertical text in tcolorbox cells, so I hope someone can help me on here on how to change my cells to the wanted sizing. Maybe there is something else in my code that is blocking me from changing the sizing without me realizing?

thank you for your help and here is a MWE:

\documentclass{article}
\usepackage{graphicx} % Required for inserting images
\usepackage[table]{xcolor}
\definecolor{swotS}{RGB}{226,237,143}
\definecolor{swotW}{RGB}{247,193,139}
\definecolor{swotO}{RGB}{173,208,187}
\definecolor{swotT}{RGB}{192,165,184}
\definecolor{qualH}{RGB}{0,102,204}
\definecolor{qualM}{RGB}{102,178,255}
\definecolor{qualL}{RGB}{204,229,255}
\definecolor{qualEmpty}{RGB}{255,255,255}
\usepackage[raster]{tcolorbox}

\begin{document}

\begin{tcbraster}[raster columns=4, boxrule=0mm, arc=0mm]
\tcbox[size=title, colback=qualEmpty!60, colframe=qualEmpty!80]{}
\tcbox[size=title, colback=swotS!60, colframe=swotS!80!black]{High probability}
\tcbox[size=title, colback=swotS!60, colframe=swotS!80!black]{Medium probability}
\tcbox[size=title, colback=swotS!60, colframe=swotS!80!black]{Low probability}

\tcbox[size=title, colback=swotS!60, colframe=swotS!80!black]{\rotatebox{90}{\textsc{High impact}}}
\begin{tcolorbox}[equal height group=A, size=fbox, colback=qualH!60, colframe=swotS!80!black]
\begin{enumerate}
\item business 1
\item business 2
\item business 3
\end{enumerate}
\tcblower
\begin{enumerate}
\item product 1
\item product 2
\item product 3
\end{enumerate}
\end{tcolorbox}
\begin{tcolorbox}[equal height group=A, size=fbox, colback=qualH!60, colframe=swotW!80!black]
\begin{enumerate}
\item business 1
\item business 2
\item business 3
\end{enumerate}
\tcblower
\begin{enumerate}
\item product 1
\item product 2
\item product 3
\end{enumerate}
\end{tcolorbox}
\begin{tcolorbox}[equal height group=A, size=fbox, colback=qualM!60, colframe=swotW!80!black]
\begin{enumerate}
\item business 1
\item business 2
\item business 3
\end{enumerate}
\tcblower
\begin{enumerate}
\item product 1
\item product 2
\item product 3
\end{enumerate}
\end{tcolorbox}

\tcbox[size=title, colback=swotS!60, colframe=swotS!80!black]{\rotatebox{90}{\textsc{Medium impact}}}
\begin{tcolorbox}[equal height group=A, size=fbox, colback=qualH!60, colframe=swotO!80!black]
\begin{enumerate}
\item business 1
\item business 2
\item business 3
\end{enumerate}
\tcblower
\begin{enumerate}
\item product 1
\item product 2
\item product 3
\end{enumerate}
\end{tcolorbox}
\begin{tcolorbox}[equal height group=A, size=fbox, colback=qualM!60, colframe=swotT!80!black]
\begin{enumerate}
\item business 1
\item business 2
\item business 3
\end{enumerate}
\tcblower
\begin{enumerate}
\item product 1
\item product 2
\item product 3
\end{enumerate}
\end{tcolorbox}
\begin{tcolorbox}[equal height group=A, size=fbox, colback=qualL!60, colframe=swotT!80!black]
\begin{enumerate}
\item business 1
\item business 2
\item business 3
\end{enumerate}
\tcblower
\begin{enumerate}
\item product 1
\item product 2
\item product 3
\end{enumerate}
\end{tcolorbox}

\tcbox[size=title, colback=swotS!60, colframe=swotS!80!black]{\rotatebox{90}{\textsc{Low impact}}}
\begin{tcolorbox}[equal height group=A, size=fbox, colback=qualM!60, colframe=swotO!80!black]
\begin{enumerate}
\item business 1
\item business 2
\item business 3
\end{enumerate}
\tcblower
\begin{enumerate}
\item product 1
\item product 2
\item product 3
\end{enumerate}
\end{tcolorbox}
\begin{tcolorbox}[equal height group=A, size=fbox, colback=qualL!60, colframe=swotT!80!black]
\begin{enumerate}
\item business 1
\item business 2
\item business 3
\end{enumerate}
\tcblower
\begin{enumerate}
\item product 1
\item product 2
\item product 3
\end{enumerate}
\end{tcolorbox}
\begin{tcolorbox}[equal height group=A, size=fbox, colback=qualL!60, colframe=swotT!80!black]
\begin{enumerate}
\item business 1
\item business 2
\item business 3
\end{enumerate}
\tcblower
\begin{enumerate}
\item product 1
\item product 2
\item product 3
\end{enumerate}
\end{tcolorbox}

\end{tcbraster}

\end{document}

The diagram with the first column being too wide

1
  • I'll go with samcarter's answer for now I think. Thank you for helping!
    – SamVV
    Commented May 25 at 8:40

1 Answer 1

6

Quick hack: Use the enhanced, rotate=90 options to let tcolorbox rotate the boxes and then use tikz={xshift=...} to fix the alignment

\documentclass{article}
\usepackage{graphicx} % Required for inserting images
\usepackage[table]{xcolor}
\definecolor{swotS}{RGB}{226,237,143}
\definecolor{swotW}{RGB}{247,193,139}
\definecolor{swotO}{RGB}{173,208,187}
\definecolor{swotT}{RGB}{192,165,184}
\definecolor{qualH}{RGB}{0,102,204}
\definecolor{qualM}{RGB}{102,178,255}
\definecolor{qualL}{RGB}{204,229,255}
\definecolor{qualEmpty}{RGB}{255,255,255}
\usepackage[raster,most]{tcolorbox}

\begin{document}

\begin{tcbraster}[
  raster columns=4, boxrule=0mm, arc=0mm, 
  raster column 1/.style={enhanced,rotate=90,height=1cm,tikz={xshift=-0.9cm},valign=center,halign=center,size=title, colback=swotS!60, colframe=swotS!80!black,fontupper=\scshape},
  raster row 1/.style={enhanced,tikz={yshift=-0.9cm},halign=center}
]
\tcbox[size=title, colback=qualEmpty!60, colframe=qualEmpty!80]{}
\tcbox[size=title, colback=swotS!60, colframe=swotS!80!black]{High probability}
\tcbox[size=title, colback=swotS!60, colframe=swotS!80!black]{Medium probability}
\tcbox[size=title, colback=swotS!60, colframe=swotS!80!black]{Low probability}

\tcbox{High impact}
\begin{tcolorbox}[equal height group=A, size=fbox, colback=qualH!60, colframe=swotS!80!black]
\begin{enumerate}
\item business 1
\item business 2
\item business 3
\end{enumerate}
\tcblower
\begin{enumerate}
\item product 1
\item product 2
\item product 3
\end{enumerate}
\end{tcolorbox}
\begin{tcolorbox}[equal height group=A, size=fbox, colback=qualH!60, colframe=swotW!80!black]
\begin{enumerate}
\item business 1
\item business 2
\item business 3
\end{enumerate}
\tcblower
\begin{enumerate}
\item product 1
\item product 2
\item product 3
\end{enumerate}
\end{tcolorbox}
\begin{tcolorbox}[equal height group=A, size=fbox, colback=qualM!60, colframe=swotW!80!black]
\begin{enumerate}
\item business 1
\item business 2
\item business 3
\end{enumerate}
\tcblower
\begin{enumerate}
\item product 1
\item product 2
\item product 3
\end{enumerate}
\end{tcolorbox}

\tcbox{Medium impact}
\begin{tcolorbox}[equal height group=A, size=fbox, colback=qualH!60, colframe=swotO!80!black]
\begin{enumerate}
\item business 1
\item business 2
\item business 3
\end{enumerate}
\tcblower
\begin{enumerate}
\item product 1
\item product 2
\item product 3
\end{enumerate}
\end{tcolorbox}
\begin{tcolorbox}[equal height group=A, size=fbox, colback=qualM!60, colframe=swotT!80!black]
\begin{enumerate}
\item business 1
\item business 2
\item business 3
\end{enumerate}
\tcblower
\begin{enumerate}
\item product 1
\item product 2
\item product 3
\end{enumerate}
\end{tcolorbox}
\begin{tcolorbox}[equal height group=A, size=fbox, colback=qualL!60, colframe=swotT!80!black]
\begin{enumerate}
\item business 1
\item business 2
\item business 3
\end{enumerate}
\tcblower
\begin{enumerate}
\item product 1
\item product 2
\item product 3
\end{enumerate}
\end{tcolorbox}

\tcbox{Low impact}
\begin{tcolorbox}[equal height group=A, size=fbox, colback=qualM!60, colframe=swotO!80!black]
\begin{enumerate}
\item business 1
\item business 2
\item business 3
\end{enumerate}
\tcblower
\begin{enumerate}
\item product 1
\item product 2
\item product 3
\end{enumerate}
\end{tcolorbox}
\begin{tcolorbox}[equal height group=A, size=fbox, colback=qualL!60, colframe=swotT!80!black]
\begin{enumerate}
\item business 1
\item business 2
\item business 3
\end{enumerate}
\tcblower
\begin{enumerate}
\item product 1
\item product 2
\item product 3
\end{enumerate}
\end{tcolorbox}
\begin{tcolorbox}[equal height group=A, size=fbox, colback=qualL!60, colframe=swotT!80!black]
\begin{enumerate}
\item business 1
\item business 2
\item business 3
\end{enumerate}
\tcblower
\begin{enumerate}
\item product 1
\item product 2
\item product 3
\end{enumerate}
\end{tcolorbox}

\end{tcbraster}

\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 .