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) */
62 /* Stuff Particular to Cartesians */
63 double ordinate_scale;
64 double abscissa_scale;
73 int chart_initialise(struct chart *ch);
75 void chart_finalise(struct chart *ch);
79 void chart_write_xlabel(struct chart *ch, const char *label);
80 void chart_write_ylabel(struct chart *ch, const char *label);
82 void chart_write_title(struct chart *ch, const char *title, ...);
84 enum tick_orientation {
89 void draw_tick(struct chart *ch, enum tick_orientation orientation,
90 double position, const char *label, ...);
101 void draw_barchart(struct chart *ch, const char *title,
102 const char *xlabel, const char *ylabel, enum bar_opts opt);
104 void draw_box_whisker_chart(struct chart *ch, const char *title);
116 void draw_histogram(struct chart *ch,
117 const struct variable *v,
119 struct normal_curve *norm,
123 double chart_rounded_tick(double tick);
126 void draw_piechart(struct chart *ch, const struct variable *v);
128 void draw_scatterplot(struct chart *ch);
131 void draw_lineplot(struct chart *ch);
134 void chart_write_xscale(struct chart *ch,
135 double min, double max, double tick);
137 void chart_write_yscale(struct chart *ch,
138 double min, double max, double tick);
141 void chart_datum(struct chart *ch, int dataset, double x, double y);
152 void chart_line(struct chart *ch, double slope, double intercept,
153 double limit1, double limit2, enum CHART_DIM limit_d);
159 The anatomy of a chart is as follows.
161 +-------------------------------------------------------------+
162 | +----------------------------------+ |
166 | +----------------------------------+ |
167 |+----------++----------------------------------++-----------+|
178 || Ordinate || Data || Legend ||
189 |+----------++----------------------------------++-----------+| --
190 | +----------------------------------+ | - ^ data_bottom
192 | | | | | abscissa_top
193 | +----------------------------------+ | v v
194 +-------------------------------------------------------------+ ----
204 |<--------------------------------------------->|| |
206 |<---------------------------------------------->| |
208 |<---------------------------------------------------------->|