X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;ds=sidebyside;f=src%2Flanguage%2Fstats%2Fcrosstabs.q;h=e5f174f00773788b18025a8d735d877939f3c5eb;hb=29917c4f5908454803e663d2ad78bca4bc35e805;hp=0665b75e6f74bf1cc3d9355ff3477ff6546b5532;hpb=1aef11b9589a534333bbecd528efe1022a4bb9bb;p=pspp diff --git a/src/language/stats/crosstabs.q b/src/language/stats/crosstabs.q index 0665b75e6f..e5f174f007 100644 --- a/src/language/stats/crosstabs.q +++ b/src/language/stats/crosstabs.q @@ -56,7 +56,6 @@ #include "libpspp/pool.h" #include "libpspp/str.h" #include "output/pivot-table.h" -#include "output/chart-item.h" #include "output/charts/barchart.h" #include "gl/minmax.h" @@ -782,12 +781,13 @@ postcalc (struct crosstabs_proc *proc) } if (proc->barchart) { - const struct variable **vars = xcalloc (xt->n_vars, sizeof *vars); - for (size_t i = 0; i < xt->n_vars; i++) + int n_vars = (xt->n_vars > 2 ? 2 : xt->n_vars); + const struct variable **vars = xcalloc (n_vars, sizeof *vars); + for (size_t i = 0; i < n_vars; i++) vars[i] = xt->vars[i].var; - chart_item_submit (barchart_create (vars, xt->n_vars, _("Count"), - false, - xt->entries, xt->n_entries)); + chart_submit (barchart_create (vars, n_vars, _("Count"), + false, + xt->entries, xt->n_entries)); free (vars); } } @@ -1097,7 +1097,7 @@ output_crosstabulation (struct crosstabs_proc *proc, struct crosstabulation *xt) if (!pivot_table_is_empty (risk)) pivot_table_submit (risk); else - pivot_table_destroy (risk); + pivot_table_unref (risk); } if (direct) @@ -1238,14 +1238,15 @@ create_crosstab_table (struct crosstabs_proc *proc, struct crosstabulation *xt, ds_put_format (&title, ", %s=", var_to_string (var)); /* Insert the formatted value of VAR without any leading spaces. */ - s = data_out (value, var_get_encoding (var), var_get_print_format (var)); + s = data_out (value, var_get_encoding (var), var_get_print_format (var), + settings_get_fmt_settings ()); ds_put_cstr (&title, s + strspn (s, " ")); free (s); } struct pivot_table *table = pivot_table_create__ ( - pivot_value_new_user_text_nocopy (ds_steal_cstr (&title))); + pivot_value_new_user_text_nocopy (ds_steal_cstr (&title)), + "Crosstabulation"); pivot_table_set_weight_format (table, &proc->weight_format); - table->omit_empty = true; struct pivot_dimension *statistics = pivot_dimension_create ( table, PIVOT_AXIS_ROW, N_("Statistics")); @@ -1285,7 +1286,6 @@ create_chisq_table (struct crosstabulation *xt) { struct pivot_table *chisq = pivot_table_create (N_("Chi-Square Tests")); pivot_table_set_weight_format (chisq, &xt->weight_format); - chisq->omit_empty = true; pivot_dimension_create ( chisq, PIVOT_AXIS_ROW, N_("Statistics"), @@ -1316,7 +1316,6 @@ create_sym_table (struct crosstabulation *xt) { struct pivot_table *sym = pivot_table_create (N_("Symmetric Measures")); pivot_table_set_weight_format (sym, &xt->weight_format); - sym->omit_empty = true; pivot_dimension_create ( sym, PIVOT_AXIS_COLUMN, N_("Values"), @@ -1356,12 +1355,12 @@ create_risk_table (struct crosstabulation *xt, { struct pivot_table *risk = pivot_table_create (N_("Risk Estimate")); pivot_table_set_weight_format (risk, &xt->weight_format); - risk->omit_empty = true; struct pivot_dimension *values = pivot_dimension_create ( risk, PIVOT_AXIS_COLUMN, N_("Values"), N_("Value"), PIVOT_RC_OTHER); pivot_category_create_group ( + /* xgettext:no-c-format */ values->root, N_("95% Confidence Interval"), N_("Lower"), PIVOT_RC_OTHER, N_("Upper"), PIVOT_RC_OTHER); @@ -1402,14 +1401,13 @@ create_direct_table (struct crosstabulation *xt) { struct pivot_table *direct = pivot_table_create (N_("Directional Measures")); pivot_table_set_weight_format (direct, &xt->weight_format); - direct->omit_empty = true; pivot_dimension_create ( direct, PIVOT_AXIS_COLUMN, N_("Values"), N_("Value"), PIVOT_RC_OTHER, N_("Asymp. Std. Error"), PIVOT_RC_OTHER, N_("Approx. T"), PIVOT_RC_OTHER, - N_("Approx Sig."), PIVOT_RC_SIGNIFICANCE); + N_("Approx. Sig."), PIVOT_RC_SIGNIFICANCE); struct pivot_dimension *statistics = pivot_dimension_create ( direct, PIVOT_AXIS_ROW, N_("Statistics"));