1 /* PSPP - computes sample statistics.
2 Copyright (C) 2004 Free Software Foundation, Inc.
3 Written by John Darrington <john@darrington.wattle.id.au>
5 This program is free software; you can redistribute it and/or
6 modify it under the terms of the GNU General Public License as
7 published by the Free Software Foundation; either version 2 of the
8 License, or (at your option) any later version.
10 This program is distributed in the hope that it will be useful, but
11 WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
29 /* Array of standard colour names */
30 extern const char *data_colour[];
36 plPlotterParams *pl_params;
38 /* The geometry of the chart
39 See diagram at the foot of this file.
57 /* Default font size for the plot (if zero, then use plotter default) */
65 int chart_initialise(struct chart *ch);
67 void chart_finalise(struct chart *ch);
71 void chart_write_title(struct chart *ch,
74 enum tick_orientation {
79 void draw_tick(struct chart *ch, enum tick_orientation orientation,
80 double position, const char *label, ...);
91 void draw_barchart(struct chart *ch, const char *title,
92 const char *xlabel, const char *ylabel, enum bar_opts opt);
94 void draw_box_whisker_chart(struct chart *ch, const char *title);
106 void draw_histogram(struct chart *ch,
107 const struct variable *v,
109 struct normal_curve *norm,
114 void draw_piechart(struct chart *ch, const struct variable *v);
116 void draw_scatterplot(struct chart *ch, const char *title,
117 const char *xlabel, const char *ylabel);
120 void draw_lineplot(struct chart *ch, const char *title,
121 const char *xlabel, const char *ylabel);
128 The anatomy of a chart is as follows.
130 +-------------------------------------------------------------+
131 | +----------------------------------+ |
135 | +----------------------------------+ |
136 |+----------++----------------------------------++-----------+|
147 || Ordinate || Data || Legend ||
158 |+----------++----------------------------------++-----------+| --
159 | +----------------------------------+ | - ^ data_bottom
161 | | | | | abscissa_top
162 | +----------------------------------+ | v v
163 +-------------------------------------------------------------+ ----
173 |<--------------------------------------------->|| |
175 |<---------------------------------------------->| |
177 |<---------------------------------------------------------->|