23c64d06129d1d7acb83cb957a81991d4af2f00e
[pspp-builds.git] / src / output / chart.h
1 /* PSPP - computes sample statistics.
2    Copyright (C) 2004 Free Software Foundation, Inc.
3
4    This program is free software; you can redistribute it and/or
5    modify it under the terms of the GNU General Public License as
6    published by the Free Software Foundation; either version 2 of the
7    License, or (at your option) any later version.
8
9    This program is distributed in the hope that it will be useful, but
10    WITHOUT ANY WARRANTY; without even the implied warranty of
11    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12    General Public License for more details.
13
14    You should have received a copy of the GNU General Public License
15    along with this program; if not, write to the Free Software
16    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
17    02110-1301, USA. */
18
19 #include <config.h>
20 #include <stdio.h>
21 #include <stdarg.h>
22 #include <string.h>
23 #include <stdio.h>
24 #include <float.h>
25 #include <assert.h>
26 #include <math.h>
27
28 #include <math/chart-geometry.h>
29 #include <libpspp/str.h>
30 #include <libpspp/alloc.h>
31 #include "manager.h"
32 #include "output.h"
33
34 #ifndef CHART_H
35 #define CHART_H
36
37 #ifndef NO_CHARTS
38 #include <plot.h>
39 #endif
40
41 struct chart {
42
43 #ifndef NO_CHARTS
44   plPlotter *lp ;
45   plPlotterParams *pl_params;
46 #else
47   void *lp;
48 #endif
49   char *file_name;
50   FILE *file;
51
52   /* The geometry of the chart
53      See diagram at the foot of this file.
54    */
55
56   int data_top   ;
57   int data_right ;
58   int data_bottom;
59   int data_left  ;
60
61   int abscissa_top;
62
63   int ordinate_right ;
64
65   int title_bottom ;
66
67   int legend_left ;
68   int legend_right ;
69
70
71   /* Default font size for the plot (if zero, then use plotter default) */
72   int font_size;
73
74   char fill_colour[10];
75
76   /* Stuff Particular to Cartesians (and Boxplots ) */
77   double ordinate_scale;
78   double abscissa_scale;
79   double x_min;
80   double x_max;
81   double y_min;
82   double y_max;
83 };
84
85
86
87 struct chart * chart_create(void);
88 void chart_submit(struct chart *ch);
89
90 #endif