diff options
author | Norbert Preining <norbert@preining.info> | 2019-09-02 13:46:59 +0900 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2019-09-02 13:46:59 +0900 |
commit | e0c6872cf40896c7be36b11dcc744620f10adf1d (patch) | |
tree | 60335e10d2f4354b0674ec22d7b53f0f8abee672 /graphics/pstricks/contrib/pst-gantt |
Initial commit
Diffstat (limited to 'graphics/pstricks/contrib/pst-gantt')
-rw-r--r-- | graphics/pstricks/contrib/pst-gantt/Changes | 10 | ||||
-rw-r--r-- | graphics/pstricks/contrib/pst-gantt/README | 18 | ||||
-rw-r--r-- | graphics/pstricks/contrib/pst-gantt/doc/pst-gantt-doc.bib | 124 | ||||
-rw-r--r-- | graphics/pstricks/contrib/pst-gantt/doc/pst-gantt-doc.pdf | bin | 0 -> 120027 bytes | |||
-rw-r--r-- | graphics/pstricks/contrib/pst-gantt/doc/pst-gantt-doc.tex | 245 | ||||
-rw-r--r-- | graphics/pstricks/contrib/pst-gantt/latex/pst-gantt.sty | 8 | ||||
-rw-r--r-- | graphics/pstricks/contrib/pst-gantt/tex/pst-gantt.tex | 218 |
7 files changed, 623 insertions, 0 deletions
diff --git a/graphics/pstricks/contrib/pst-gantt/Changes b/graphics/pstricks/contrib/pst-gantt/Changes new file mode 100644 index 0000000000..221fbfbb6c --- /dev/null +++ b/graphics/pstricks/contrib/pst-gantt/Changes @@ -0,0 +1,10 @@ +..... pst-gantt.tex +0.22a 2014-12-14 - fixed typos in the documentation +0.22 2013-10-27 - fixed spurious space +0.21 2010-02-23 - add optional arguments + ChartModulo and ChartModuloValue +0.20 2009-05-12 - first CTAN version + + +..... pst-gantt.sty + 2009-05-12 first version diff --git a/graphics/pstricks/contrib/pst-gantt/README b/graphics/pstricks/contrib/pst-gantt/README new file mode 100644 index 0000000000..cd88515bb1 --- /dev/null +++ b/graphics/pstricks/contrib/pst-gantt/README @@ -0,0 +1,18 @@ +pst-gantt: plotting Gantt charts + +Save the files pst-gantt.sty|pro|tex in a directory, which is part of your +local TeX tree. The pro file should go into $TEXMF/dvips/pstricks/ +Then do not forget to run texhash to update this tree. +For more information see the documentation of your LATEX distribution +on installing packages into your local TeX system or read the +TeX Frequently Asked Questions: +(http://www.tex.ac.uk/cgi-bin/texfaq2html?label=instpackages). + +pst-func needs pst-plot (pstricks-add) and pstricks, which should +be part of your local TeX installation, otherwise get it from a +CTAN server, f.ex. ftp://ftp.ctan.org + +PSTricks is PostScript Tricks, the documentation cannot be run +with pdftex, use the sequence latex->dvips->ps2pdf. + +%% $Id: README 117 2009-05-13 05:54:00Z herbert $ diff --git a/graphics/pstricks/contrib/pst-gantt/doc/pst-gantt-doc.bib b/graphics/pstricks/contrib/pst-gantt/doc/pst-gantt-doc.bib new file mode 100644 index 0000000000..786230fb6a --- /dev/null +++ b/graphics/pstricks/contrib/pst-gantt/doc/pst-gantt-doc.bib @@ -0,0 +1,124 @@ +%% -*-bibtex-*- +@STRING{tugboat = {TUGboat} } +@STRING{beiprogramm = {{\TeX}-Beiprogramm} } +@STRING{bretter = {Bretter, die die Welt bedeuten} } +@STRING{dtk = {{D}ie {\TeX}nische {K}om{\"o}die} } +@STRING{editorial = {Editorial} } +@STRING{fremdebuehne = {Von fremden B{\"u}hnen} } +@STRING{fundus = {Aus dem Fundus} } +@STRING{hinterbuehne = {Hinter der B{\"u}hne} } +@STRING{leserbrief = {Leserbrief(e)} } +@STRING{magazin = {Magazin} } +@STRING{rezension = {Rezensionen} } +@STRING{schonimmer = {Was Sie schon immer {\"u}ber {\TeX} wissen wollten \dots} } +@STRING{theaterkasse = {Von der Theaterkasse} } +@STRING{theatertage = {{\TeX}-Theatertage} } + +@Book{tlgc2, + author = {Michel Goosens and Frank Mittelbach and Sebastian Rahtz and Denis Roegel and Herbert Vo{\ss}}, + title = {The {\LaTeX} {G}raphics {C}ompanion}, + publisher = {{Addison-Wesley Publishing Company}}, + edition = second, + year = {2007}, + address = {Reading, Mass.} +} + +@Article{girou:01:, + author = {Denis Girou}, + title = {Pr\'esentation de {PST}ricks}, + journal = {Cahier {GUT}enberg}, + year = 1994, + volume = {16}, + month = apr, + pages = {21-70} +} + +@Article{girou:02:, + author = {{Timothy van} Zandt and Denis Girou}, + title = {Inside {PST}ricks}, + journal = TUGboat, + year = 1994, + volume = {15}, + month = sep, + pages = {239-246} +} + +@Book{PostScript, + Author = {Kollock, Nikolai G.}, + Title = {Post{S}cript richtig eingesetzt: vom {K}onzept zum + praktischen {E}insatz}, + Publisher = {IWT}, + Address = {Vaterstetten}, + year = 1989, +} + +@Manual{pstricks, + Title = {PSTricks - {\PS} macros for generic {\TeX}}, + Author = {{Timothy van} Zandt}, + Organization = {}, + Address = {\url{http://www.tug.org/application/PSTricks}}, + Note = {}, + year = 1993 +} + +@Manual{pst-plot, + Title = {\texttt{pst-plot}: Plotting two dimensional functions and data}, + Author = {{Timothy van} Zandt}, + Organization = {}, + Address = {\url{CTAN:graphics/pstricks/generic/pst-plot.tex}}, + Note = {}, + year = 1999 +} + +@Manual{multido, + Title = {\texttt{multido.tex} - a loop macro, that supports fixed-point addition}, + Author = {{Timothy van} Zandt}, + Organization = {}, + Address = {\url{CTAN:/graphics/pstricks/generic/multido.tex}}, + Note = {}, + year = 1997 +} + +@Book{PSTricks2, + author = {Herbert Vo\ss{}}, + title = {\texttt{PSTricks} -- {G}rafik f\"ur \TeX{} und \LaTeX}, + edition = {6.}, + publisher = {DANTE -- Lehmanns}, + year = {2010}, + address = {Heidelberg/Hamburg} +} + +@Book{PSTricksE, + author = {Herbert Vo\ss{}}, + title = {\texttt{PSTricks} -- {G}raphics and {P}ost{S}cript for \LaTeX}, + edition = {1.}, + publisher = {UIT}, + year = {2011}, + address = {Cambridge -- UK} +} + +@Book{LTXquick, + author = {Herbert Vo\ss{}}, + title = {{\LaTeX} quick reference}, + edition = {1.}, + publisher = {UIT}, + year = {2012}, + address = {Cambridge -- UK} +} + +@Book{presentations, + author = {Herbert Vo\ss}, + title = {Presentations with \LaTeX}, + edition = {1.}, + publisher = {DANTE -- Lehmanns Media}, + year = {2012}, + address = {Heidelberg/Berlin} +} +@Manual{wolfram, + author = {Eric Weisstein}, + title = {Wolfram MathWorld}, + publisher = {{Wolfram}}, + year = {2007}, + address = {\url{http://mathworld.wolfram.com}} +} + diff --git a/graphics/pstricks/contrib/pst-gantt/doc/pst-gantt-doc.pdf b/graphics/pstricks/contrib/pst-gantt/doc/pst-gantt-doc.pdf Binary files differnew file mode 100644 index 0000000000..3d3dd36fbc --- /dev/null +++ b/graphics/pstricks/contrib/pst-gantt/doc/pst-gantt-doc.pdf diff --git a/graphics/pstricks/contrib/pst-gantt/doc/pst-gantt-doc.tex b/graphics/pstricks/contrib/pst-gantt/doc/pst-gantt-doc.tex new file mode 100644 index 0000000000..bc9cf03276 --- /dev/null +++ b/graphics/pstricks/contrib/pst-gantt/doc/pst-gantt-doc.tex @@ -0,0 +1,245 @@ +%% $Id: pst-func-doc.tex 86 2009-01-29 10:34:00Z herbert $ +\documentclass[11pt,english,BCOR10mm,DIV12,bibliography=totoc,parskip=false,smallheadings + headexclude,footexclude,oneside]{pst-doc} +\usepackage[utf8]{inputenc} +\usepackage{pst-gantt} +\let\pstganttFV\fileversion +\usepackage{pstricks-add} +\usepackage{lscape} +\lstset{explpreset={pos=l,width=0.4\linewidth,overhang=0pt,hsep=\columnsep,vsep=\bigskipamount,rframe={}}, + escapechar=?} +% +\begin{document} + +\title{\texttt{pst-gantt}} +\subtitle{gantt charts; v.\pstganttFV} +\author{Denis Girou\\Herbert Vo\ss} +\docauthor{Herbert Vo\ss} +\date{\today} +\maketitle + +\tableofcontents + +\clearpage + +\begin{abstract} +\noindent +\LPack{pst-gantt} loads by default the following packages: \LPack{pst-node}, +\LPack{pst-grad}, \LPack{pst-xkey}, and, of course \LPack{pstricks}. +All should be already part of your local \TeX\ installation. If not, or in case +of having older versions, go to \url{http://www.CTAN.org/} and load the newest version. + +\vfill\noindent +%Thanks to: \\ +%and last but not least \url{http://mathworld.wolfram.com} + +\end{abstract} + +\section{Environments and Macros} + +The main environemnt is \Lenv{PstGanttChart} with the following syntax: + +\begin{BDef} +\LBEG{PstGanttChart}\OptArgs\Largb{vertical units}\Largb{horizontal units}\\ +\ldots +\LEND{PstGanttChart}\\[5pt] +\Lcs{PstGanttTask}\OptArgs\Largb{Start}\Largb{End} +\end{BDef} + + + + +\begingroup +\begin{LTXexample} +\newpsstyle{Important}{fillstyle=solid,fillcolor=red} +\newpsstyle{NotImportant}{fillstyle=vlines} +\begin{PstGanttChart}{5}{7} +\PstGanttTask{0}{3} +\PstGanttTask{2}{1} +\PstGanttTask[TaskStyle=Important, + TaskInsideLabel=Important]{2}{5} +\PstGanttTask[TaskStyle=NotImportant]{4}{2} +\PstGanttTask{5}{2} +\end{PstGanttChart} +\end{LTXexample} +\endgroup +\xLkeyset{fillstyle=vlines}\xLenv{PstGanttChart}\xLcs{PstGanttTask}\xLkeyword{TaskStyle} +\xLkeyword{TaskInsideLabel} +% Example 2 +% + +\begingroup +\begin{LTXexample} +\newpsstyle{Important}{fillstyle=solid,fillcolor=red} +\newpsstyle{NotImportant}{fillstyle=vlines} +\begin{PstGanttChart}[yunit=2]{5}{7} +\PstGanttTask{0}{3} +\PstGanttTask{2}{1} +\PstGanttTask[TaskStyle=Important,% + TaskInsideLabel=Important]{2}{5} +\PstGanttTask[TaskStyle=NotImportant]{4}{2} +\PstGanttTask{5}{2} +\end{PstGanttChart} +\end{LTXexample} +\endgroup +\xLkeyset{fillstyle=vlines}\xLenv{PstGanttChart}\xLcs{PstGanttTask}\xLkeyword{TaskStyle} +\xLkeyword{TaskInsideLabel} + +\vspace{1cm} +% +% Example 3 +% + +\begingroup +\begin{LTXexample}[pos=t] +\newpsstyle{Important}{fillstyle=solid,fillcolor=red} +\newpsstyle{NotImportant}{fillstyle=vlines} +\begin{PstGanttChart}[unit=2,TaskOutsideLabelMaxSize=1, + ChartShowIntervals]{5}{7} +\PstGanttTask[TaskOutsideLabel={Task 1}]{0}{3} +\PstGanttTask[TaskOutsideLabel={Task 2},TaskUnitType=Day]{15}{3}%3 days start at 15 +\PstGanttTask[TaskStyle=Important,TaskOutsideLabel={Task 3}, + TaskInsideLabel={\Large\textcolor{white}{\textbf{Important}}}]{2}{5} +\PstGanttTask[TaskStyle=NotImportant,TaskOutsideLabel={Task 4}]{4}{2} +\PstGanttTask[TaskOutsideLabel={Task 5}]{5}{2} +\end{PstGanttChart} +\end{LTXexample} +\endgroup +\xLkeyset{fillstyle=vlines}\xLenv{PstGanttChart}\xLcs{PstGanttTask}\xLkeyword{TaskStyle} +\xLkeyword{TaskOutsideLabel}\xLkeyword{TaskOutsideLabelMaxSize}\xLkeyword{ChartShowIntervals} +\xLkeyword{TaskInsideLabel}\xLkeyset{TaskUnitType=Day} + + +% +% Example 4 +% +\psset{unit=1cm} +\begin{LTXexample}[pos=t] +\begin{PstGanttChart}[yunit=1.5, + ChartUnitIntervalName=KW,ChartUnitBasicIntervalName=KW, + ChartModulo,ChartModuloValue=52, + TaskUnitIntervalValue=14,TaskUnitType=KW,ChartStartInterval=49, + ChartShowIntervals]{4}{8} + \PstGanttTask[TaskInsideLabel={Task 1}]{0}{1} + \PstGanttTask[TaskInsideLabel={Task 2}]{3}{4} + \PstGanttTask[TaskInsideLabel={Task 3}]{2}{2} + \PstGanttTask[TaskInsideLabel={Task 4}]{3}{5} +\end{PstGanttChart} +\end{LTXexample} +\xLkeyword{ChartModulo} +\xLkeyword{ChartModuloValue} +\xLkeyword{ChartStartInterval} + +% +% Example 5 +% +\begin{LTXexample}[pos=t] +\begin{PstGanttChart}[yunit=2,ChartUnitIntervalName=Month, + TaskUnitIntervalValue=30,TaskUnitType=Month,ChartShowIntervals]{3}{4} +\PstGanttTask[TaskInsideLabel={Task 1}]{0}{1} +\PstGanttTask[TaskInsideLabel={Task 2},TaskUnitType=Day]{24}{40}% 40 days start at 24 +\PstGanttTask[TaskInsideLabel={Task 3}]{2}{2} +\end{PstGanttChart} +\end{LTXexample} +\xLkeyset{TaskUnitType=Day}\xLkeyset{TaskUnitType=Month}\xLkeyset{ChartUnitIntervalName=Month} +\xLkeyset{TaskUnitIntervalName=Month}\xLkeyset{TaskUnitIntervalValue=Month}\xLkeyword{ChartShowIntervals} + +% +% Example 6 +% +\begin{LTXexample} +\begin{PstGanttChart}[yunit=1.5, + ChartUnitIntervalName=Year, + ChartUnitBasicIntervalName=Month, + TaskUnitIntervalValue=12, + TaskUnitType=Year, + ChartShowIntervals]{4}{4} +\PstGanttTask[TaskInsideLabel={Task 1}]{0}{1} +\PstGanttTask[TaskInsideLabel={Task 2}, + TaskUnitType=Month]{6}{24}% 24 months start at 6 +\PstGanttTask[TaskInsideLabel={Task 3}]{2}{2} +\PstGanttTask[TaskInsideLabel={Task 4}]{3}{1} +\end{PstGanttChart} +\end{LTXexample} +\xLkeyword{yunit} +\xLkeyword{ChartUnitIntervalName=Year} +\xLkeyword{ChartUnitBasicIntervalName=Month} +\xLkeyword{TaskUnitIntervalValue=12} +\xLkeyword{TaskUnitType=Year} +\xLkeyword{ChartShowIntervals} + + + + +\begin{landscape} +\definecolor{LightCyan} {rgb}{0.88,1.,1.} +\definecolor{Orange} {rgb}{1.,0.65,0.} +\definecolor{PaleGreen} {rgb}{0.6,0.98,0.6} +\definecolor{Pink} {rgb}{1.,0.75,0.8} +\psset{gradmidpoint=0,fillstyle=gradient,gradbegin=LightCyan,gradend=white} +\newpsstyle{TaskStyleA}{gradbegin=cyan,gradend=blue} +\newpsstyle{TaskStyleB}{gradbegin=red,gradend=Pink} +\newpsstyle{TaskStyleC}{gradbegin=yellow,gradend=Orange} +\newpsstyle{TaskStyleD}{gradbegin=green,gradend=PaleGreen} + +\begin{PstGanttChart}[yunit=2.5,xunit=3.5,ChartUnitIntervalName=Semaine, + ChartUnitBasicIntervalName=Jour,TaskUnitType=Jour, + TaskOutsideLabelMaxSize=14,ChartShowIntervals]{8}{43} + \psset{gradangle=90,TaskStyle=TaskStyleA} + \PstGanttTask[TaskOutsideLabel={\'Etude}]{0}{10} + \PstGanttTask[TaskOutsideLabel={R\'edaction dossier}]{6}{7} + \PstGanttTask[TaskOutsideLabel={Relecture et corrections}]{14}{2} + \PstGanttTask[TaskOutsideLabel={Soumission},TaskStyle=TaskStyleB]{17}{1} + \psset{TaskStyle=TaskStyleC} + \PstGanttTask[TaskOutsideLabel={R\'ealisation}]{25}{14} + \PstGanttTask[TaskOutsideLabel={Tests}]{35}{6} + \PstGanttTask[TaskOutsideLabel={V\'erification}]{39}{3} + \PstGanttTask[TaskOutsideLabel={Recette},TaskStyle=TaskStyleD]{42}{1} +\end{PstGanttChart} +\end{landscape} + +\begin{lstlisting} +\definecolor{LightCyan} {rgb}{0.88,1.,1.} +\definecolor{Orange} {rgb}{1.,0.65,0.} +\definecolor{PaleGreen} {rgb}{0.6,0.98,0.6} +\definecolor{Pink} {rgb}{1.,0.75,0.8} +\psset{gradmidpoint=0,fillstyle=gradient,gradbegin=LightCyan,gradend=white} +\newpsstyle{TaskStyleA}{gradbegin=cyan,gradend=blue} +\newpsstyle{TaskStyleB}{gradbegin=red,gradend=Pink} +\newpsstyle{TaskStyleC}{gradbegin=yellow,gradend=Orange} +\newpsstyle{TaskStyleD}{gradbegin=green,gradend=PaleGreen} + +\begin{PstGanttChart}[yunit=2.5,xunit=3.5,ChartUnitIntervalName=Semaine, + ChartUnitBasicIntervalName=Jour,TaskUnitType=Jour, + TaskOutsideLabelMaxSize=14,ChartShowIntervals]{8}{43} + \psset{gradangle=90,TaskStyle=TaskStyleA} + \PstGanttTask[TaskOutsideLabel={\'Etude}]{0}{10} + \PstGanttTask[TaskOutsideLabel={R\'edaction dossier}]{6}{7} + \PstGanttTask[TaskOutsideLabel={Relecture et corrections}]{14}{2} + \PstGanttTask[TaskOutsideLabel={Soumission},TaskStyle=TaskStyleB]{17}{1} + \psset{TaskStyle=TaskStyleC} + \PstGanttTask[TaskOutsideLabel={R\'ealisation}]{25}{14} + \PstGanttTask[TaskOutsideLabel={Tests}]{35}{6} + \PstGanttTask[TaskOutsideLabel={V\'erification}]{39}{3} + \PstGanttTask[TaskOutsideLabel={Recette},TaskStyle=TaskStyleD]{42}{1} +\end{PstGanttChart} +\end{lstlisting} + +\section{List of all optional arguments for \texttt{pst-gantt}} + +\xkvview{family=pst-gantt,columns={key,type,default}} + +\bgroup +\raggedright +\nocite{*} +\bibliographystyle{plain} +\bibliography{pst-gantt-doc} +\egroup + +\printindex + + + +\end{document} + + diff --git a/graphics/pstricks/contrib/pst-gantt/latex/pst-gantt.sty b/graphics/pstricks/contrib/pst-gantt/latex/pst-gantt.sty new file mode 100644 index 0000000000..e73fcf3cd5 --- /dev/null +++ b/graphics/pstricks/contrib/pst-gantt/latex/pst-gantt.sty @@ -0,0 +1,8 @@ +\RequirePackage{pstricks} +\ProvidesPackage{pst-gantt}[2008/03/21 package wrapper for + pst-gantt.tex (hv)] +\input{pst-gantt.tex} +\ProvidesFile{pst-gantt.tex} + [\filedate\space v\fileversion\space `pst-gantt' (hv)] +\endinput +%% $Id: pst-gantt.sty 116 2009-05-12 22:12:03Z herbert $ diff --git a/graphics/pstricks/contrib/pst-gantt/tex/pst-gantt.tex b/graphics/pstricks/contrib/pst-gantt/tex/pst-gantt.tex new file mode 100644 index 0000000000..b2117f6add --- /dev/null +++ b/graphics/pstricks/contrib/pst-gantt/tex/pst-gantt.tex @@ -0,0 +1,218 @@ +%% +%% This is file `pst-gantt.tex', +%% +%% IMPORTANT NOTICE: +%% +%% Package `pst-gantt.tex' +%% +%% Denis Girou, Herbert Voss +%% +%% This program can be redistributed and/or modified under the terms +%% of the LaTeX Project Public License Distributed from CTAN archives +%% in directory macros/latex/base/lppl.txt. +%% +%% DESCRIPTION: +%% `pst-gantt' is a PSTricks package to draw GANTT diagrams and timelines +%% +\csname PSTganttLoaded\endcsname +\let\PSTganttLoaded\endinput +% Require PSTricks, pst-node, pstcol, pst-plot, pst-3d packages +\ifx\PSTricksLoaded\endinput\else\input pstricks.tex\fi +\ifx\PSTnodesLoaded\endinput\else\input pst-node.tex\fi +\ifx\PSTplotLoaded\endinput\else \input pst-grad.tex\fi +\ifx\PSTXKeyLoaded\endinput\else \input pst-xkey.tex\fi +\ifx\MultidoLoaded\endinput\else \input multido.tex \fi +% +\edef\PstAtCode{\the\catcode`\@} +\catcode`\@=11\relax +% +% interface to the `xkeyval' package +\pst@addfams{pst-gantt} +% +\def\fileversion{0.22a} +\def\filedate{2014/12/14} +\message{`pst-gantt' v\fileversion, \filedate\space (Denis Girou and Herbert Voss)} +% +% "pspicture" environment or not? +\define@boolkey[psset]{pst-gantt}[Pst@]{PstPicture}[true]{} +\psset[pst-gantt]{PstPicture=true} +% Intervals to show? +\define@boolkey[psset]{pst-gantt}[Pst@]{ChartShowIntervals}[true]{} +\psset[pst-gantt]{ChartShowIntervals=false} +\define@key[psset]{pst-gantt}{ChartStartInterval}[1]{\def\psk@GanttStartInterval{#1}} +\psset[pst-gantt]{ChartStartInterval=1} +% +\define@boolkey[psset]{pst-gantt}[Pst@]{ChartModulo}[true]{} +\psset[pst-gantt]{ChartModulo=false} +\define@key[psset]{pst-gantt}{ChartModuloValue}[52]{\def\psk@ChartModuloValue{#1}} +\psset[pst-gantt]{ChartModuloValue=52} +% +% Style for the tasks +\define@key[psset]{pst-gantt}{TaskStyle}[TaskStyleDefault]{\def\psk@GanttTaskStyle{#1}} +\psset[pst-gantt]{TaskStyle=TaskStyleDefault} +% Name for unit interval +\define@key[psset]{pst-gantt}{ChartUnitIntervalName}[Week]{\def\psk@GanttChartUnitIntervalName{#1}} +% Name for basic unit +\define@key[psset]{pst-gantt}{ChartUnitBasicIntervalName}[Day]{% + \def\psk@GanttChartUnitBasicIntervalName{#1}} +% Unit interval for the tasks (7 for a week, 30 for a month, etc.) +% Warning: define it before "TaskUnitType"! +\define@key[psset]{pst-gantt}{TaskUnitIntervalValue}[7]{% + \pst@cntg=#1\relax + \edef\psk@GanttTaskUnitIntervalValue{\the\pst@cntg}} +% Unit type for the tasks (UnitIntervalName or UnitBasicIntervalName) +\define@key[psset]{pst-gantt}{TaskUnitType}[Week]{% + \def\psk@GanttTaskUnitValue{#1}% +% Validation of the parameter + \ifx\psk@GanttTaskUnitValue\psk@GanttChartUnitIntervalName + \edef\psk@GanttTaskUnitValue{\psk@GanttTaskUnitIntervalValue}% + \else + \ifx\psk@GanttTaskUnitValue\psk@GanttChartUnitBasicIntervalName + \def\psk@GanttTaskUnitValue{1}% + \else + {\@pstrickserr{GanttTaskUnitType must be `\psk@GanttChartUnitIntervalName' + or `\psk@GanttChartUnitBasicIntervalName' + (and not `\psk@GanttTaskUnitValue')}\@eha}% + \fi + \fi} +% Outside label for the tasks +\define@key[psset]{pst-gantt}{TaskOutsideLabel}[]{\def\psk@GanttTaskOutsideLabel{#1}} +% Inside label for the tasks +\define@key[psset]{pst-gantt}{TaskInsideLabel}[]{\def\psk@GanttTaskInsideLabel{#1}} +% Maximum outside size label for the tasks (in unit TaskUnitType !) +\define@key[psset]{pst-gantt}{TaskOutsideLabelMaxSize}[0]{% + \pst@cntg=#1\relax + \edef\psk@GanttTaskOutsideLabelMaxSize{\the\pst@cntg}} +% Default values +% -------------- +% pspicture environment, don't show intervals, default task style, +% unit for tasks is a week (so 7 days), no outside and inside labels +\psset[pst-gantt]{ChartUnitIntervalName=Week,ChartUnitBasicIntervalName=Day, + TaskUnitIntervalValue=7,TaskUnitType=Week, + TaskOutsideLabel=,TaskInsideLabel=,TaskOutsideLabelMaxSize=0} +\newpsstyle{TaskStyleDefault}{fillstyle=solid,fillcolor=yellow} +% The environment \PstGanttChart +% ------------------------------ +\SpecialCoor +% +% Syntax: \PstGanttChart[parameters]{Number of tasks}{Number of days} +\def\PstGanttChart{\@ifnextchar[\PstGanttChart@i{\PstGanttChart@i[]}} +\def\PstGanttChart@i[#1]#2#3{% +\begingroup +\psset{unit=0.1,#1} % Affectation of local parameters +% +\ifPst@PstPicture % "pspicture" environment + \pst@cnta=\psk@GanttTaskOutsideLabelMaxSize + \multiply\pst@cnta\psk@GanttTaskUnitValue + % + \pst@cntb=#2 + \multiply\pst@cntb by 5 + \advance\pst@cntb\@ne + % + \pst@cntc=#3 + \multiply\pst@cntc\psk@GanttTaskUnitValue + \advance\pst@cntc\tw@ + % + \ifPst@ChartShowIntervals + \pspicture(-\pst@cnta,-\pst@cntb)(\pst@cntc,2) + \else + \pspicture(-\pst@cnta,-\pst@cntb)(\pst@cntc,0) + \fi +\fi +\psframe(0,-\pst@cntb)(\pst@cntc,0) +% +\ifPst@ChartShowIntervals + % We will show the intervals + \pst@cnta=#3 + \multiply\pst@cnta\psk@GanttTaskUnitValue + \divide\pst@cnta\psk@GanttTaskUnitIntervalValue + \advance\pst@cnta\@ne + % + \pst@cntb=#2 + \multiply\pst@cntb by 5 + \advance\pst@cntb\@ne + % + \pst@dima=\psk@GanttTaskUnitIntervalValue pt + \divide\pst@dima\tw@ + \advance\pst@dima\@ne pt + \pst@dimtonum{\pst@dima}{\pst@tempa} + % + \multido{\iStartInterval=\psk@GanttStartInterval+1,\iInterval=1+1, + \iIntervalPos=1+\psk@GanttTaskUnitIntervalValue, + \nIntervalPos=\pst@tempa+\psk@GanttTaskUnitIntervalValue.0}{\pst@cnta}{% + \ifnum\iInterval=\pst@cnta + \psline(\iIntervalPos,0)(\iIntervalPos,1.5) + \psline[linestyle=dotted](\iIntervalPos,-\pst@cntb)(\iIntervalPos,0) + \else + \ifPst@ChartModulo + \pst@mod{\iStartInterval}{\psk@ChartModuloValue}\pst@iInterval% + \pst@cntm=\pst@iInterval \advance\pst@cntm by \@ne + \rput(\nIntervalPos,1){\psk@GanttChartUnitIntervalName\space\the\pst@cntm} + \else + \rput(\nIntervalPos,1){\psk@GanttChartUnitIntervalName\space\iStartInterval} + \fi + \psline(\iIntervalPos,0)(\iIntervalPos,1.5) + \psline[linestyle=dotted](\iIntervalPos,-\pst@cntb)(\iIntervalPos,0) + \fi} +\fi} +\def\endPstGanttChart{% +\ifPst@PstPicture + \endpspicture % End of "pspicture" environment +\fi +\endgroup} +% The macro \PstGanttTask +% ----------------------- +\newcount\pst@GanttTaskCnt +\pst@GanttTaskCnt=\z@ +% Syntax: \PstGanttTask[parameters]{Start}{Length} +\def\PstGanttTask{\@ifnextchar[\PstGanttTask@i{\PstGanttTask@i[]}} +\def\PstGanttTask@i[#1]#2#3{% +\advance\pst@GanttTaskCnt\m@ne +\begingroup +\psset{#1}% % Affectation of local parameters +% Frame +\pst@cnta=\psk@GanttTaskUnitValue +\multiply\pst@cnta by #2 +\advance\pst@cnta\@ne +% +\pst@cntb=\psk@GanttTaskUnitValue +\multiply\pst@cntb by #3 +\advance\pst@cntb\pst@cnta +% +\pst@cntc=\pst@GanttTaskCnt +\multiply\pst@cntc by 5 +% +\pst@cntd=\pst@cntc +\advance\pst@cntd by 4 +% +\psframe[style=\psk@GanttTaskStyle](\pst@cnta,\pst@cntc)(\pst@cntb,\pst@cntd) +% Inside label +\ifx\psk@GanttTaskInsideLabel\empty +\else + \pst@dima=\pst@cnta pt + \advance\pst@dima\pst@cntb pt + \divide\pst@dima\tw@ + \pst@dimtonum{\pst@dima}{\pst@tempa} + % + \pst@dimb=\pst@cntc pt + \advance\pst@dimb\pst@cntd pt + \divide\pst@dimb\tw@ + \pst@dimtonum{\pst@dimb}{\pst@tempb} + % + \rput(\pst@tempa,\pst@tempb){\psk@GanttTaskInsideLabel} +\fi +% Outside label +\ifx\psk@GanttTaskOutsideLabel\empty +\else + \pst@dimb=\pst@cntc pt + \advance\pst@dimb\pst@cntd pt + \divide\pst@dimb\tw@ + \pst@dimtonum{\pst@dimb}{\pst@tempb} + \rput[r](-1.5,\pst@tempb){\psk@GanttTaskOutsideLabel} +\fi +\endgroup} +% +\catcode`\@=\PstAtCode\relax +%% END: pst-gantt.tex +\endinput + |