1 /* PSPP - a program for statistical analysis.
2 Copyright (C) 2012 Free Software Foundation, Inc.
4 This program is free software: you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation, either version 3 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program. If not, see <http://www.gnu.org/licenses/>. */
19 #include "output/charts/spreadlevel-plot.h"
23 #include "output/cairo-chart.h"
26 #define _(msgid) gettext (msgid)
29 xrchart_draw_spreadlevel (const struct chart_item *chart_item, cairo_t *cr,
30 struct xrchart_geometry *geom)
32 const struct spreadlevel_plot_chart *sl = to_spreadlevel_plot_chart (chart_item);
35 const char *name = chart_item_get_title (chart_item);
37 xrchart_write_title (cr, geom, _("Spread vs. Level Plot of %s"), name);
38 xrchart_write_xlabel (cr, geom, _("Level"));
39 xrchart_write_ylabel (cr, geom, _("Spread"));
42 xrchart_write_xscale (cr, geom, sl->x_lower, sl->x_upper);
43 xrchart_write_yscale (cr, geom, sl->y_lower, sl->y_upper);
45 for (i = 0 ; i < sl->n_data; ++i)
47 xrchart_datum (cr, geom, 0, sl->data[i].x, sl->data[i].y);