4

How can I rotate a pie chart with 50,50 distribution so that it is divided vertically rather than horizontally?

\documentclass{beamer}
\usepackage{multicol}
\usepackage{datapie}
\usetheme{Warsaw}
\begin{filecontents}{institutes.csv}
Name,Quantity
"ERD", 50
"NERD",50
\end{filecontents}
\begin{filecontents}{population.csv}
Name,Quantity
"ERD", 30
"NERD", 70
\end{filecontents}

\DTLloaddb{institute}{institutes.csv}
\DTLloaddb{population}{population.csv}

\begin{document}
\begin{frame}{Are all the gastroesophageal reflux disease patients same? }
\begin{exampleblock}
{All patients present with  heart burn \texttt{and/or} regurgitation of sour fluid in mouth }So all these patients are same with varying severity of symptoms?
\end{exampleblock}
\begin{itemize}
\item upper gastro-intestinal endoscopy 
\item 24 hour Ph-metry 
\end{itemize}
\end{frame}

%-------------------------------------------------------------------------------------------------------------------------
\begin{frame}{Endoscopy Data}
\begin{columns}{2}
\begin{column}{0.4\textwidth}
\begin{figure}[htbp]
\DTLpiechart{variable=\quantity,outerlabel=\name}{institute}{%
\name=Name,\quantity=Quantity}
\caption{Institute data} 
\end{figure}
\end{column}
\begin{column}{0.4\textwidth}
\begin{figure}[htbp]
\DTLpiechart{variable=\quantity,outerlabel=\name}{population}{%
\name=Name,\quantity=Quantity}
\caption{Population data}
\end{figure}
\end{column}
\end{columns}
\end{frame}
\end{document}
7

You can set the starting angle of the first segment by the setting start=90. The value is 0 by default.

    \DTLpiechart{variable=\quantity,outerlabel=\name,start=90,radius=1.8cm,outerratio=1.1}{institute}{%
\name=Name,\quantity=Quantity}

I have made some other changes too in the settings so that the chart looks more good.

\documentclass{beamer}
\usepackage{multicol}
\usepackage{datapie}
\usetheme{Warsaw}
\begin{filecontents}{institutes.csv}
Name,Quantity
"ERD", 50
"NERD",50
\end{filecontents}
\begin{filecontents}{population.csv}
Name,Quantity
"ERD", 30
"NERD", 70
\end{filecontents}

\DTLloaddb{institute}{institutes.csv}
\DTLloaddb{population}{population.csv}

\begin{document}
\begin{frame}{Are all the gastroesophageal reflux disease patients same? }
\begin{exampleblock}
{All patients present with  heart burn \texttt{and/or} regurgitation of sour fluid in mouth }So all these patients are same with varying severity of symptoms?
\end{exampleblock}
\begin{itemize}
\item upper gastro-intestinal endoscopy
\item 24 hour Ph-metry
\end{itemize}
\end{frame}

%-------------------------------------------------------------------------------------------------------------------------
\begin{frame}{Endoscopy Data}
\begin{columns}
\begin{column}{0.5\textwidth}
\begin{figure}[htbp]
\DTLpiechart{variable=\quantity,outerlabel=\name,start=90,radius=1.8cm,outerratio=1.1}{institute}{%
\name=Name,\quantity=Quantity}
\caption{Institute data}
\end{figure}
\end{column}%
\hfill
\begin{column}{0.5\textwidth}
\begin{figure}[htbp]
\DTLpiechart{variable=\quantity,outerlabel=\name,start=90,radius=1.8cm,outerratio=1.1}{population}{%
\name=Name,\quantity=Quantity}
\caption{Population data}
\end{figure}
\end{column}
\end{columns}
\end{frame}
\end{document}

enter image description here

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.