- ds_destroy (&pair_name);
-
- tab_headers (table, header_cols, 0, header_rows, 0);
-
- /* Vertical lines inside the box */
- tab_box (table, 0, 0, -1, TAL_1,
- 1, 0, tab_nc (table) - 1, tab_nr (table) - 1 );
-
- /* Box around entire table */
- tab_box (table, TAL_2, TAL_2, -1, -1,
- 0, 0, tab_nc (table) - 1, tab_nr (table) - 1 );
-
- tab_vline (table, TAL_2, header_cols, 0, tab_nr (table) - 1);
- tab_hline (table, TAL_2, 0, tab_nc (table) - 1, header_rows);
-
- tab_text (table, 0, 0, TAB_CENTER, var_to_string ((*vp)[0]));
-
- tab_joint_text (table, 1, 0, 2, 0, TAB_CENTER, var_to_string ((*vp)[1]));
- tab_hline (table, TAL_1, 1, tab_nc (table) - 1, 1);
-
-
- tab_text (table, 0, header_rows + 0, TAB_LEFT, ds_cstr (&val0str));
- tab_text (table, 0, header_rows + 1, TAB_LEFT, ds_cstr (&val1str));
-
- tab_text (table, header_cols + 0, 1, TAB_LEFT, ds_cstr (&val0str));
- tab_text (table, header_cols + 1, 1, TAB_LEFT, ds_cstr (&val1str));
-
- tab_double (table, header_cols + 0, header_rows + 0, TAB_RIGHT, param->n00, NULL, RC_WEIGHT);
- tab_double (table, header_cols + 0, header_rows + 1, TAB_RIGHT, param->n01, NULL, RC_WEIGHT);
- tab_double (table, header_cols + 1, header_rows + 0, TAB_RIGHT, param->n10, NULL, RC_WEIGHT);
- tab_double (table, header_cols + 1, header_rows + 1, TAB_RIGHT, param->n11, NULL, RC_WEIGHT);
+ struct pivot_dimension *vars[2];
+ for (int i = 0; i < 2; i++)
+ {
+ vars[i] = pivot_dimension_create__ (
+ table, i ? PIVOT_AXIS_COLUMN : PIVOT_AXIS_ROW,
+ pivot_value_new_variable ((*vp)[i]));
+ vars[i]->root->show_label = true;
+
+ for (int j = 0; j < 2; j++)
+ {
+ const union value *val = j ? ¶m->val1 : ¶m->val0;
+ pivot_category_create_leaf_rc (
+ vars[i]->root, pivot_value_new_var_value ((*vp)[0], val),
+ PIVOT_RC_COUNT);
+ }
+ }