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,
118 const struct freq_tab *frq_tab,
120 struct normal_curve *norm,
124 double chart_rounded_tick(double tick);
127 void draw_piechart(struct chart *ch, const struct variable *v,
128 const struct freq_tab *);
130 void draw_scatterplot(struct chart *ch);
133 void draw_lineplot(struct chart *ch);
136 void chart_write_xscale(struct chart *ch,
137 double min, double max, double tick);
139 void chart_write_yscale(struct chart *ch,
140 double min, double max, double tick);
143 void chart_datum(struct chart *ch, int dataset, double x, double y);
154 void chart_line(struct chart *ch, double slope, double intercept,
155 double limit1, double limit2, enum CHART_DIM limit_d);
161 The anatomy of a chart is as follows.
163 +-------------------------------------------------------------+
164 | +----------------------------------+ |
168 | +----------------------------------+ |
169 |+----------++----------------------------------++-----------+|
180 || Ordinate || Data || Legend ||
191 |+----------++----------------------------------++-----------+| --
192 | +----------------------------------+ | - ^ data_bottom
194 | | | | | abscissa_top
195 | +----------------------------------+ | v v
196 +-------------------------------------------------------------+ ----
206 |<--------------------------------------------->|| |
208 |<---------------------------------------------->| |
210 |<---------------------------------------------------------->|