X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Foutput%2Fcharts%2Fplot-chart.h;h=896b630b137e7245f679c15c5437e7b8a47168fe;hb=8b71948cd57dbd2787cb4c50525b957e9be8a62b;hp=e8bb7d42ce8befdbcbf27c4e2bfb2e68959771c4;hpb=a19b858e0ac3c69e4a28c0ca6d8674427268a863;p=pspp-builds.git diff --git a/src/output/charts/plot-chart.h b/src/output/charts/plot-chart.h index e8bb7d42..896b630b 100644 --- a/src/output/charts/plot-chart.h +++ b/src/output/charts/plot-chart.h @@ -1,23 +1,23 @@ -/* PSPP - computes sample statistics. - Copyright (C) 2004 Free Software Foundation, Inc. - Written by John Darrington +/* PSPP - a program for statistical analysis. + Copyright (C) 2004, 2009 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. - This program is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - General Public License for more details. + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA - 02110-1301, USA. */ + along with this program. If not, see . */ -#include +#ifndef PLOT_CHART_H +#define PLOT_CHART_H + +#include #include #include #include @@ -29,44 +29,70 @@ #include #include +#include +#include #include -#include #include #include +#define N_CHART_COLOURS 9 +extern const struct chart_colour data_colour[]; -#ifndef PLOT_CHART_H -#define PLOT_CHART_H +enum tick_orientation + { + TICK_ABSCISSA=0, + TICK_ORDINATE + }; - -extern const char *data_colour[]; +struct chart_geometry; -enum tick_orientation { - TICK_ABSCISSA=0, - TICK_ORDINATE -}; +enum marker_type + { + MARKER_CIRCLE, /* Hollow circle. */ + MARKER_ASTERISK, /* Asterisk (*). */ + MARKER_SQUARE /* Hollow square. */ + }; + +void chart_draw_marker (cairo_t *, double x, double y, enum marker_type, + double size); + +void chart_label (cairo_t *, int horz_justify, int vert_justify, + double font_size, const char *); /* Draw a tick mark at position If label is non zero, then print it at the tick mark */ -void draw_tick(struct chart *chart, - enum tick_orientation orientation, - double position, - const char *label, ...); +void draw_tick(cairo_t *, const struct chart_geometry *, + enum tick_orientation orientation, + double position, + const char *label, ...) + PRINTF_FORMAT (5, 6); /* Write the title on a chart*/ -void chart_write_title(struct chart *chart, const char *title, ...); +void chart_write_title(cairo_t *, const struct chart_geometry *, + const char *title, ...) + PRINTF_FORMAT (3, 4); /* Set the scale for the abscissa */ -void chart_write_xscale(struct chart *ch, double min, double max, int ticks); +void chart_write_xscale(cairo_t *, struct chart_geometry *, + double min, double max, int ticks); /* Set the scale for the ordinate */ -void chart_write_yscale(struct chart *ch, double smin, double smax, int ticks); +void chart_write_yscale(cairo_t *, struct chart_geometry *, + double smin, double smax, int ticks); + +void chart_write_xlabel(cairo_t *, const struct chart_geometry *, + const char *label) ; + +/* Write the ordinate label */ +void chart_write_ylabel(cairo_t *, const struct chart_geometry *, + const char *label); +void chart_write_legend (cairo_t *, const struct chart_geometry *); #endif