/* PSPP - a program for statistical analysis.
- Copyright (C) 2004, 2009 Free Software Foundation, Inc.
+ 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
#include <output/chart-provider.h>
#include <data/variable.h>
+#include <libpspp/cast.h>
#include <libpspp/hash.h>
#include <output/chart.h>
#include <math/histogram.h>
{
char *buf = xasprintf ("N = %.2f", n);
cairo_move_to (cr, geom->legend_left, y);
- chart_label (cr, 'l', 'b', buf);
+ chart_label (cr, 'l', 'b', geom->font_size, buf);
y += geom->font_size * 1.5;
free (buf);
}
{
char *buf = xasprintf ("Mean = %.1f", mean);
cairo_move_to (cr,geom->legend_left, y);
- chart_label (cr, 'l', 'b', buf);
+ chart_label (cr, 'l', 'b', geom->font_size, buf);
y += geom->font_size * 1.5;
free (buf);
}
{
char *buf = xasprintf ("Std. Dev = %.2f", stddev);
cairo_move_to (cr, geom->legend_left, y);
- chart_label (cr, 'l', 'b', buf);
+ chart_label (cr, 'l', 'b', geom->font_size, buf);
free (buf);
}
histogram_chart_draw (const struct chart *chart, cairo_t *cr,
struct chart_geometry *geom)
{
- struct histogram_chart *h = (struct histogram_chart *) chart;
+ struct histogram_chart *h = UP_CAST (chart, struct histogram_chart, chart);
int i;
int bins;
static void
histogram_chart_destroy (struct chart *chart)
{
- struct histogram_chart *h = (struct histogram_chart *) chart;
+ struct histogram_chart *h = UP_CAST (chart, struct histogram_chart, chart);
if (h->gsl_hist != NULL)
gsl_histogram_free (h->gsl_hist);
free (h->label);