#include "math/chart-geometry.h"
-#include "output/chart-item.h"
#include "output/charts/barchart.h"
#include "output/charts/piechart.h"
#include "output/charts/plot-hist.h"
const struct freq_tab *ft = &vf->tab;
struct pivot_table *table = pivot_table_create__ (pivot_value_new_variable (
- vf->var));
+ vf->var), "Frequencies");
pivot_table_set_weight_var (table, wv);
pivot_dimension_create (table, PIVOT_AXIS_COLUMN, N_("Statistics"),
/* Summary statistics. */
ft->valid_cases = 0.0;
- for(i = 0 ; i < ft->n_valid ; ++i )
+ for(i = 0 ; i < ft->n_valid ; ++i)
{
f = &ft->valid[i];
ft->valid_cases += f->count;
}
ft->total_cases = ft->valid_cases ;
- for(i = 0 ; i < ft->n_missing ; ++i )
+ for(i = 0 ; i < ft->n_missing ; ++i)
{
f = &ft->missing[i];
ft->total_cases += f->count;
histogram = freq_tab_to_hist (frq, &vf->tab, vf->var);
- if ( histogram)
+ if (histogram)
{
- chart_item_submit (histogram_chart_create (
- histogram->gsl_hist, var_to_string(vf->var),
- vf->tab.valid_cases,
- d[FRQ_ST_MEAN],
- d[FRQ_ST_STDDEV],
- frq->hist->draw_normal));
+ chart_submit (histogram_chart_create (
+ histogram->gsl_hist, var_to_string(vf->var),
+ vf->tab.valid_cases,
+ d[FRQ_ST_MEAN],
+ d[FRQ_ST_STDDEV],
+ frq->hist->draw_normal));
statistic_destroy (&histogram->parent);
}
lex_match (lexer, T_SLASH);
if (lex_match_id (lexer, "VARIABLES"))
{
- if (! lex_force_match (lexer, T_EQUALS) )
+ if (! lex_force_match (lexer, T_EQUALS))
goto error;
}
}
else if (lex_match_id (lexer, "FREQ"))
{
- if ( lex_match (lexer, T_LPAREN))
+ if (lex_match (lexer, T_LPAREN))
{
if (lex_force_num (lexer))
{
}
else if (lex_match_id (lexer, "PERCENT"))
{
- if ( lex_match (lexer, T_LPAREN))
+ if (lex_match (lexer, T_LPAREN))
{
if (lex_force_num (lexer))
{
histogram = histogram_create (bin_width, x_min, x_max);
- if ( histogram == NULL)
+ if (histogram == NULL)
return NULL;
for (i = 0; i < ft->n_valid; i++)
msg (SW, _("Omitting pie chart for %s, which has over 50 unique values."),
var_get_name (var));
else
- chart_item_submit (piechart_create (var, slices, n_slices));
+ chart_submit (piechart_create (var, slices, n_slices));
free (slices);
}
int n_slices;
struct freq **slices = pick_cat_counts_ptr (bar, frq_tab, &n_slices);
- chart_item_submit (barchart_create (var, 1,
- (bar->y_scale == FRQ_FREQ) ? _("Count") : _("Percent"),
- (bar->y_scale == FRQ_PERCENT),
- slices, n_slices));
+ if (n_slices < 1)
+ msg (SW, _("Omitting bar chart, which has no values."));
+ else
+ chart_submit (barchart_create (var, 1,
+ (bar->y_scale == FRQ_FREQ) ? _("Count") : _("Percent"),
+ (bar->y_scale == FRQ_PERCENT),
+ slices, n_slices));
free (slices);
}