TransWikia.com

Horizontal Barcharts with text on both ends and a tick mark on the chart

TeX - LaTeX Asked by gastino on January 22, 2021

I want to create a set of horizontal barcharts with text on both ends and a tick mark. The idea is to symbolize a value between two extremes/endpoints. Below is an illustration of what I want it to look like.

I have tried using baritem from barchart, but I cannot figure out how to put text on both ends

enter image description here

One Answer

enter image description here

documentclass[tikz, margin=3mm]{standalone}
usepackage{siunitx}
usetikzlibrary{positioning,calc}
begin{document}
    begin{tikzpicture}
    draw[line width=12pt, blue] 
    (0,0)node[label=left:Introversion](a){} --   (8,0)node[label=right:Extroversion](b){};
    
draw[line width=6pt,yellow!95!green!90!red!40]  ($(a)!0.80!(b)$)node[](c){}--++(0,1cm);

    end{tikzpicture}
end{document}

edit for black border on the extruded yellow portion

enter image description here

documentclass[tikz, margin=3mm]{standalone}
usepackage{siunitx}
usetikzlibrary{positioning,calc}
begin{document}
    begin{tikzpicture}
    draw[line width=12pt, blue] 
    (0,0)node[label=left:Introversion](a){} --   
    (8,0)node[label=right:Extroversion](b){};
    
filldraw[draw=black, fill=yellow,line width=2pt, yshift=2em, xshift=14em]  
         (0pt,-5pt)+($(a)!.80!(b)$) rectangle (1,1);

    end{tikzpicture}
end{document}

Correct answer by js bibra on January 22, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP