X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Foutput%2Fcharts%2Fcartesian.c;h=c57745a311c13563561c332eb5a91fc9fb635d44;hb=c246143823df29e9ce4c5115c647a47954dea883;hp=1350a155de8e8f756b45fa813c6d14fe094f82b0;hpb=000e3e8c5818476c3afbc75fad9347aefb6e902a;p=pspp diff --git a/src/output/charts/cartesian.c b/src/output/charts/cartesian.c index 1350a155de..c57745a311 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 @@ -19,10 +18,13 @@ #include -#include "chart.h" #include -#include "plot-chart.h" -#include "cartesian.h" + +#include + +#include +#include +#include @@ -42,93 +44,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)