I am writing my Bachelor thesis and I am facing some issues drawing a spiderweb diagram. I am trying to load my data from a csv file using the csvsimple package, but latex is interpreting D1 to D7 as functions. Is there any way to prevent pgf to do that?
This is the error: ! Package PGF Math Error: Unknown function `D1' (in 'D1-11').
\documentclass[cleardoublepage=empty, listof=totoc, bibliography=totoc, index=totoc, 11pt, abstracton, numbers=noenddot, oneside,titlepage,openright,headings=normal]{scrreprt}
\usepackage{filecontents}
\usepackage{csvsimple}
\usepackage{tikz}
\usepackage{pgfplots}
\usetikzlibrary{shapes}
\begin{document}
\begin{filecontents*}{data.csv}
Vertreter;Portability;Compatibility;Performance efficiency;Usability;Security;Reliability;Functional Suitability
SAPUI5;12,4;10,4;11,0;14,9;10,5;15,0;15,0
Apache Cordova;11,9;13,2;10,7;9,9;11,0;15,0;14,8
Xamarin;11,4;13,2;15,0;12,8;11,9;15,0;14,1
Android ;7,8;13,2;15,0;12,8;11,9;15,0;14,1
\end{filecontents*}
\newcommand{\D}{7} % number of dimensions (config option)
\newcommand{\U}{7} % number of scale units (config option)
\newdimen\R % maximal diagram radius (config option)
\R=3.5cm
\newdimen\L % radius to put dimension labels (config option)
\L=4.5cm
\newcommand{\A}{360/\D} % calculated angle between dimension axes
\begin{figure}
\centering
\begin{tikzpicture}[scale=1]
\path (0:0cm) coordinate (O); % define coordinate for origin
% draw the spiderweb
\foreach \X in {1,...,\D}{
\draw (\X*\A:0) -- (\X*\A:\R);
}
\foreach \Y in {0,...,\U}{
\foreach \X in {1,...,\D}{
\path (\X*\A:\Y*\R/\U) coordinate (D\X-\Y);
\fill (D\X-\Y) circle (1pt);
}
\draw [opacity=0.3] (0:\Y*\R/\U) \foreach \X in {1,...,\D}{
-- (\X*\A:\Y*\R/\U)
} -- cycle;
}
% define labels for each dimension axis (names config option)
\path (1*\A:\L) node (L1) {\tiny Portabilität};
\path (2*\A:\L) node (L2) {\tiny Kompatibilität};
\path (3*\A:\L) node (L3) {\tiny Leistungseffizienz};
\path (4*\A:\L) node (L4) {\tiny Usability};
\path (5*\A:\L) node (L5) {\tiny Sicherheit};
\path (6*\A:\L) node (L6) {\tiny Verlässlichkeit};
\path (7*\A:\L) node (L7) {\tiny Funkt. Eignung};
\csvreader[separator=semicolon]
{data.csv}
{Vertreter=\v,Portability=\port,Compatibility=\comp,Performance efficiency=\perf,Usability=\use,Security=\secur,Reliability=\rel,Functional Suitability=\func}
{
\draw[color=blue,line width=1.5pt,opacity=0.5]
(D1-\perf) --
(D2-\comp) --
(D3-\perf) --
(D4-\use) --
(D5-\secur) --
(D6-\rel) --
(D7-\func) -- cycle;
}
\end{tikzpicture}
\caption{Spiderweb Diagram (\D~Dimensions, \U-Notch Scale, 3 Samples)}
\label{fig:spiderweb}
\end{figure}
\end{document}

\documentclassincluding all needed packages and settings (and only those) and a document body from\begin{document}down to\end{document}. This would help us to reproduce your problem, test our suggestions and (ideally) post a solution. – Schweinebacke Nov 06 '17 at 07:5911,4. In your loop you have(D1-\perf), so that becomes(D1-11,4). TikZ sees a pair of parentheses with two things separated by a comma and thinks, "this must be a Cartesian coordinate". The y-component,4is OK, but it doesn't know anything calledD1-11, and you get an error. So that is why. My question is, what exactly did you expect? – Torbjørn T. Nov 06 '17 at 08:54tkz-kiviatpackage. Seethe related questions Problem drawing Kiviat diagram, How to change the grad scale values with tkzKiviatDiagram? or filled Kiviat diagrams: How to add numerical values near each ball automatically. – Bobyandbob Nov 06 '17 at 17:22