Hi I am trying to create a pie chart and have used the following code to do so. I import everything properly, however, I cannot use my created "data" command for some reason. I get the error "Undefined Control Sequence". What am I doing wrong:
\documentclass[tikz]{article}
\usepackage[utf8]{inputenc}
\usepackage{pdflscape}
\usepackage[table]{xcolor}
\usepackage[landscape, a4paper, bottom=0cm, margin=0in, top=2cm]{geometry}
\usepackage{pgfplots}
\usepackage{array}
\usepackage{caption}
\usepackage{subcaption}
\usepackage[T1]{fontenc}
\usepackage[cm]{sfmath}
\usepackage{fancyhdr}
\usepackage{eso-pic}
\usepackage{titleps}
\usepackage{lipsum}
\usepackage[pdf]{pstricks}
%Header Stuff
\newpagestyle{myheader}{%
\sethead{}{\sffamily\large\raisebox{6ex}{\parbox{2cm}{
\hspace*{10cm}
\includegraphics[width=2in]{images/toptrack_logo.png}
}}}{}
}
%Customization
\newcolumntype{L}[1]{>{\raggedright\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}
\newcolumntype{C}[1]{>{\centering\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}
\newcolumntype{R}[1]{>{\raggedleft\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}
\pgfplotsset{compat=newest} % Allows to place the legend below plot
\usepgfplotslibrary{
units, % Allows to enter the units nicely
groupplots
}
%Piechart
\degrees[100]
\newcounter{counter}
\SpecialCoor
\newcommand\data[2][gray]{%
\pswedge[fillstyle=solid,fillcolor=#1,opacity=.5](0,0){4}{!\thecounter}{!\thecounter\space #2 add}%
\uput{2}[!#2 2 div \thecounter\space add](0,0){#2\%}%
\addtocounter{counter}{#2}%
}
\newcommand{\tabitem}{}
\pagenumbering{gobble}
\renewcommand{\familydefault}{\sfdefault}
\definecolor{customgrey}{RGB}{78,74,68}
\definecolor{customblue}{RGB}{70,179,211}
\definecolor{customblack1}{RGB}{35,31,32}
\definecolor{customblack2}{RGB}{64,64,66}
\definecolor{customdarkblue}{RGB}{79,129,189}
\definecolor{customlightblue}{RGB}{142,174,213}
\definecolor{customdarkred}{RGB}{192,80,77}
\definecolor{customlightred}{RGB}{217,147,145}
\title{test}
\author{sinasohi}
\date{January 2017}
\begin{document}
%\maketitle
\include{Page0}
\pagestyle{myheader}{
\AddToShipoutPictureBG{%
\AtPageLowerLeft{
\hspace{-0.25cm}
\includegraphics[width=30cm]{images/toptrack_footer.png}
}}{
\include{Page1}
\include{Page2}
\include{Page3}
\include{Page4}
\include{Page5}
}}
\end{document}
Where I "use" my piechart in a Page3:
\hspace{2cm}{\Huge \color{customblack1} ABCD inddeling}
\begin{pspicture}(-4.5,-4.5)(4.5,4.5)
\data[red]{10}
\data[orange]{40}
\data[yellow]{30}
\data[blue]{20}
\end{pspicture}
\include
something into a page style like that.\include
always starts a new page, so it can't go into the background of this one.