+ if (t->summary_axis != t->slabels_axis)
+ {
+ struct pivot_dimension *d = pivot_dimension_create (
+ pt, t->slabels_axis, N_("Summaries"));
+ const struct ctables_summary_spec_set *specs = &t->summary_specs;
+ for (size_t i = 0; i < specs->n; i++)
+ pivot_category_create_leaf (
+ d->root, pivot_value_new_text (specs->specs[i].label));
+ }
+
+ if (t->clabels_example)
+ {
+ struct pivot_dimension *d = pivot_dimension_create (
+ pt, t->label_axis[t->clabels_from_axis],
+ t->clabels_from_axis == PIVOT_AXIS_ROW
+ ? N_("Row Categories")
+ : N_("Column Categories"));
+ const struct variable *var = t->clabels_example;
+ const struct ctables_categories *c = t->categories[var_get_dict_index (var)];
+ for (size_t i = 0; i < t->n_clabels_values; i++)
+ {
+ const union value *value = &t->clabels_values[i];
+ const struct ctables_category *cat = ctables_categories_match (c, value, var);
+ if (!cat)
+ {
+ /* XXX probably missing */
+ continue;
+ }
+ pivot_category_create_leaf (d->root, ctables_category_create_label (
+ cat, t->clabels_example, value));
+ }
+ }
+