Charts – How to Create a Pie Chart with Text Outside the Pie Using PSTricks

chartspstricks

I'm able to draw pie chart using tex code mentioned below:

\documentclass[landscape,a3paper,11pt]{article}
\usepackage{pstricks-add}
\usepackage{pgfplots, pgfplotstable}
\begin{document}
\begin{center}
\begin{pspicture}(-5,-4)(4,4)
\psset{unit=1.2}
\psChart[userColor={black!10,black!40},chartSep=10pt,chartNodeI=0.5,shadow,shadowsize=3pt]{10,90}{}{3}
\bfseries
\rput(psChartI1){Above 10 \%}
\rput(psChartI2){Below 90 \%}
\end{pspicture}
\end{center}
\end{document}

I want to move text inside pie chart to outside (as highlighted in RED color) can you please suggest?

enter image description here

Best Answer

You must use the outer nodes (with letter O) for the positioning (see texdoc pstricks-add):

\documentclass[pstricks]{standalone}
\usepackage{pstricks-add}
\begin{document}
\begin{pspicture}(-7,-4)(7,4)
\psset{unit=1.2}
\psChart[userColor={black!10,black!40},shadow,shadowsize=3pt, chartNodeO=1.15]{10,90}{}{3}
\bfseries
\ncline[arrows=<-, arrowscale=1.5, nodesepB=2pt]{psChartI1}{psChartO1}
\ncline[arrows=<-, arrowscale=1.5, nodesepB=2pt]{psChartI2}{psChartO2}
\rput[l](psChartO1){Above 10 \%}
\rput[r](psChartO2){Below 90 \%}
\end{pspicture}
\end{document}

That gives:

enter image description here

Related Question