CORRELATIONS: Documented the /STATISTICS subcommand
[pspp-builds.git] / src / output / charts / barchart.c
index 64f3f2c391ad01443fc8e6ab890b86ba081e468e..f3b10011cc959700a156d8b042f820aa9c07f246 100644 (file)
@@ -1,20 +1,18 @@
-/* PSPP - computes sample statistics.
-   Copyright (C) 2004 Free Software Foundation, Inc.
+/* 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 <http://www.gnu.org/licenses/>. */
 
 
 #include <config.h>
@@ -143,14 +141,14 @@ draw_barchart(struct chart *ch, const char *title,
 
       pl_savestate_r(ch->lp);
 
-      draw_tick (ch, TICK_ABSCISSA, x + (interval_size/2 ),
+      draw_tick (ch, TICK_ABSCISSA, x + (interval_size/2 ), "%s",
                 cat_labels[i]);
 
       for(sc = 0 ; sc < SUB_CATAGORIES ; ++sc )
        {
 
          pl_savestate_r(ch->lp);
-         pl_fillcolorname_r(ch->lp,data_colour[sc]);
+         pl_fillcolorname_r(ch->lp,data_colour[sc % N_CHART_COLOURS]);
 
          switch ( opt )
            {
@@ -204,7 +202,7 @@ draw_barchart(struct chart *ch, const char *title,
   pl_restorestate_r(ch->lp);
 
 
-  chart_write_title(ch, title);
+  chart_write_title(ch, "%s", title);
 
   write_legend(ch);