X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Foutput%2Fcharts%2Fcartesian.c;h=3f4c782b84a04359e0b89e737a32b2946f01604c;hb=9105b67fe006fe41c044e3659325594a52d0c899;hp=2a9b1c5fcbbf33f30bf00e28cf53f59d39531ad5;hpb=2322678e8fddbbf158b01b2720db2636404bba3b;p=pspp-builds.git diff --git a/src/output/charts/cartesian.c b/src/output/charts/cartesian.c index 2a9b1c5f..3f4c782b 100644 --- a/src/output/charts/cartesian.c +++ b/src/output/charts/cartesian.c @@ -1,6 +1,5 @@ /* PSPP - computes sample statistics. Copyright (C) 2004 Free Software Foundation, Inc. - Written by John Darrington This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as @@ -18,12 +17,16 @@ 02110-1301, USA. */ +#include + #include -#include "chart.h" #include -#include "plot-chart.h" -#include "cartesian.h" -#include "compiler.h" + +#include + +#include +#include +#include @@ -43,93 +46,6 @@ static const struct dataset dataset[DATASETS] = }; - - -static void -write_legend(struct chart *chart, const char *heading, int n); - - - -/* Write the abscissa label */ -void -chart_write_xlabel(struct chart *ch, const char *label) -{ - if ( ! ch ) - return ; - - pl_savestate_r(ch->lp); - - pl_move_r(ch->lp,ch->data_left, ch->abscissa_top); - pl_alabel_r(ch->lp,0,'t',label); - - pl_restorestate_r(ch->lp); - -} - - - -/* Write the ordinate label */ -void -chart_write_ylabel(struct chart *ch, const char *label) -{ - if ( ! ch ) - return ; - - pl_savestate_r(ch->lp); - - pl_move_r(ch->lp, ch->data_bottom, ch->ordinate_right); - pl_textangle_r(ch->lp, 90); - pl_alabel_r(ch->lp, 0, 0, label); - - pl_restorestate_r(ch->lp); -} - - - -static void -write_legend(struct chart *chart, const char *heading, - int n) -{ - int ds; - - if ( ! chart ) - return ; - - - pl_savestate_r(chart->lp); - - pl_filltype_r(chart->lp,1); - - pl_move_r(chart->lp, chart->legend_left, - chart->data_bottom + chart->font_size * n * 1.5); - - pl_alabel_r(chart->lp,0,'b',heading); - - for (ds = 0 ; ds < n ; ++ds ) - { - pl_fmove_r(chart->lp, - chart->legend_left, - chart->data_bottom + chart->font_size * ds * 1.5); - - pl_savestate_r(chart->lp); - pl_fillcolorname_r(chart->lp,data_colour[ds]); - pl_fboxrel_r (chart->lp, - 0,0, - chart->font_size, chart->font_size); - pl_restorestate_r(chart->lp); - - pl_fmove_r(chart->lp, - chart->legend_left + chart->font_size * 1.5, - chart->data_bottom + chart->font_size * ds * 1.5); - - pl_alabel_r(chart->lp,'l','b',dataset[ds].label); - } - - - pl_restorestate_r(chart->lp); -} - - /* Plot a data point */ void chart_datum(struct chart *ch, int dataset UNUSED, double x, double y)