e425987b9a5f66f1c5bd8d5327fda31e6909f43d
[pspp] / src / output / charts / plot-chart.h
1 /* PSPP - a program for statistical analysis.
2    Copyright (C) 2004, 2009 Free Software Foundation, Inc.
3
4    This program is free software: you can redistribute it and/or modify
5    it under the terms of the GNU General Public License as published by
6    the Free Software Foundation, either version 3 of the License, or
7    (at your option) any later version.
8
9    This program is distributed in the hope that it will be useful,
10    but WITHOUT ANY WARRANTY; without even the implied warranty of
11    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12    GNU 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, see <http://www.gnu.org/licenses/>. */
16
17 #ifndef PLOT_CHART_H
18 #define PLOT_CHART_H
19
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
29 #include <math/chart-geometry.h>
30 #include <output/chart.h>
31 #include <output/chart-provider.h>
32
33 #include <libpspp/compiler.h>
34 #include <libpspp/str.h>
35 #include <output/manager.h>
36 #include <output/output.h>
37
38 #define N_CHART_COLOURS 9
39 extern const struct chart_colour data_colour[];
40
41 enum tick_orientation
42   {
43     TICK_ABSCISSA=0,
44     TICK_ORDINATE
45   };
46
47 struct chart_geometry;
48
49
50 /* Draw a tick mark at position
51    If label is non zero, then print it at the tick mark
52 */
53 void draw_tick(plPlotter *, const struct chart_geometry *,
54           enum tick_orientation orientation,
55           double position,
56                const char *label, ...)
57   PRINTF_FORMAT (5, 6);
58
59
60 /* Write the title on a chart*/
61 void   chart_write_title(plPlotter *, const struct chart_geometry *,
62                          const char *title, ...)
63   PRINTF_FORMAT (3, 4);
64
65
66 /* Set the scale for the abscissa */
67 void  chart_write_xscale(plPlotter *, struct chart_geometry *,
68                          double min, double max, int ticks);
69
70
71 /* Set the scale for the ordinate */
72 void  chart_write_yscale(plPlotter *, struct chart_geometry *,
73                          double smin, double smax, int ticks);
74
75 void chart_write_xlabel(plPlotter *, const struct chart_geometry *,
76                         const char *label) ;
77
78 /* Write the ordinate label */
79 void  chart_write_ylabel(plPlotter *, const struct chart_geometry *,
80                          const char *label);
81
82 #endif