RaspberryPi
LaTeX
Linux
Virtualisierung
RaspberryPi
LaTeX
Linux
Virtualisierung
Dies ist eine alte Version des Dokuments!
\documentclass[paper=a4,12pt,version=last]{scrreprt} \usepackage[left=1.0cm, right=1.0cm, top=2.5cm, bottom=2.5cm,landscape]{geometry} \usepackage[utf8]{inputenc} \usepackage[ngerman]{babel} % Plots / Diagramm \usepackage{pgfplots} % Euro-Sign \usepackage{textcomp} % header and footer %\usepackage{fancyhdr} -> für den fall, dass die Seitenzahl entfernt werden soll %% Filecontents ist nur für Testdaten hier gedacht, die Daten sollten sich in dieser Form in einer lesbaren Textdatei befinden \begin{filecontents}{testdaten.dat} xtick xticklabel Kosten Sollzeit Ist-Arbeitszeit ybar2 ybar3 Variable 1 01.\ Feb\ '14 0 8.5 0 1.25 1.5 7 2 02.\ Feb\ '14 0 8.5 0 2.25 2.5 6 3 03.\ Feb\ '14 0 8 8.00 3.25 3.5 5 4 04.\ Feb\ '14 499.6 8 8.00 4.25 4.5 6 5 05.\ Feb\ '14 258.94 8 8.00 5.25 5.5 3 6 06.\ Feb\ '14 147.42 8 4.50 6.25 6.5 7 7 07.\ Feb\ '14 273.11 8 8.00 7.25 7.5 3 8 08.\ Feb\ '14 0 8.5 0 8.25 8.5 2 9 09.\ Feb\ '14 0 8.5 0 9.25 9.5 4 10 10.\ Feb\ '14 269.96 8 8.00 10.25 10.5 4 11 11.\ Feb\ '14 241.30 8 7.00 11.25 11.5 6 \end{filecontents} %Kopf einlesen %\input{../tmp_data/mitarbeiter_monat_kopf.tex} %% KOPFDATEN -> \newcommand{\DBFILE}[0]{testdaten.dat} \newcommand{\YMAXkosten}[0]{500} % Scalierung der Y-Achse sollte nach bedarf berechnet werden \newcommand{\YMAXsollistzeit}[0]{20} % Scalierung an die Arbeitzeit koppeln \newcommand{\XMAX}[0]{11} % Monat + 0.5, wegen 2 bars, bei 30 tagen -> 30.5 und bei 31->31.5 usw \newcommand{\MONTH}[0]{Februar } %Leerzeichen beachten! \newcommand{\MITARBEITER}[0]{"6666" } \newcommand{\TITEL}[0]{Kosten für 2083 von Max Mustermann} \newcommand{\BARWIDTH}[0]{6} % Balkenbreite %% <- KOPFDATEN % %Farben definieren wegen tikz % define colors > \definecolor{blue}{HTML}{4573A7} \definecolor{red}{HTML}{A52A2A} \definecolor{green}{HTML}{88A44D} \definecolor{violett}{HTML}{71588F} \definecolor{cyan}{HTML}{4298AF} % türkis \definecolor{orange}{HTML}{DB843D} % define colors < % -------------- % - END CONFIG - % -------------- % ----------------- % - Start Document- % ----------------- \begin{document} \pgfplotsset{compat=1.5} \begin{figure}[htbp] \centering{\textbf{\TITEL}}\vspace*{10pt} %\centering{\textbf{Kosten im \MONTH \DATEYEAR von Mitarbeiter: \MITARBEITER }}\vspace*{10pt} \begin{tikzpicture} \pgfplotsset{ %globale Einstellungen scale only axis, enlargelimits=0.05, enlarge y limits=0.01, tick label style={font=\small}, % Font Size of Tick-Label xmax=\XMAX, %max Anzahl der Tage + 0.5, damit der 2. Balken auch zu sehen xtick align=outside, scaled ticks = false, clip=false, width=23cm, height=15cm, legend columns=2, legend style={cells={anchor=west}} %legende = linksbündige ausrichtung } % Fake-Diagramm, damit das Y-Grid im Hintergrund bleibt \begin{axis}[ axis y line*=left, axis x line* = bottom, ymajorgrids=true, ymax=\YMAXkosten, ylabel=Kosten, yticklabel={\pgfmathprintnumber[fixed,fixed zerofill,precision=2, use comma]{\tick} \textsf{\texteuro} }, xlabel=Datum, xtick=data, % alle ticks werden als 'string' geschrieben x tick label style={rotate=45, anchor=east}, xticklabels from table={\DBFILE}{xticklabel} ] \addplot[transparent, forget plot ]table [x=xtick, y=Kosten] {\DBFILE}; \end{axis} % Ist-Arbeitszeit \begin{axis}[ axis y line* = right, axis x line = none, ylabel = Ist-Arbeitszeit, ymin = 0,ymax = \YMAXsollistzeit, %nodes near coords={\scriptsize{\pgfmathprintnumber[fixed,fixed zerofill,precision=2, use comma]{\pgfplotspointmeta}}}, %nodes near coords align={auto} ] \addlegendimage{/pgfplots/refstyle=KostenPLOT}\addlegendentry{Kosten pro Tag} \addplot[ybar, color=green, fill=green, %opacity=.85, %alpha-wert ybar legend, bar width=\BARWIDTH, ] table [x=ybar2, y=Ist-Arbeitszeit] {\DBFILE}; \addlegendentry{Arbeitszeit} %Blind entry \addplot[transparent, forget plot % no legend entry ] table [x=xtick, y=Sollzeit]{\DBFILE}; % wird benötigt, damit der Istarbeitszeitbalken neben den Kostenbalken ist %Sollzeit \addplot[color=red] table [x=ybar2, y=Sollzeit] {\DBFILE}; \addlegendentry{Soll-Arbeitszeit} \end{axis} % Kosten \begin{axis}[ axis y line =none, axis x line = none, ymax=\YMAXkosten, ytick=\empty, nodes near coords={\scriptsize{\pgfmathprintnumber[fixed,fixed zerofill,precision=0, use comma]{\pgfplotspointmeta}\textsf{\texteuro}}}, nodes near coords align={auto} ] \addplot[ybar, bar width=\BARWIDTH, ybar legend, color=blue, fill=blue ]table [x=xtick, y=Kosten] {\DBFILE}; \label{KostenPLOT} \end{axis} \end{tikzpicture} \end{figure} \end{document}