One factored boxplots remove the name of the factor variables, since
these can be inferred from the chart title. Also trim off any
leading whitespace from the values. This reduces the chances of the
labels clashing with one another when many boxplots appear on the
same chart.
Closes bug #38132
/*
PSPP - a program for statistical analysis.
/*
PSPP - a program for statistical analysis.
- Copyright (C) 2012 Free Software Foundation, Inc.
+ Copyright (C) 2012, 2013 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
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
ds_init_empty (&label);
for (ivar_idx = 0; ivar_idx < iact->n_vars; ++ivar_idx)
{
ds_init_empty (&label);
for (ivar_idx = 0; ivar_idx < iact->n_vars; ++ivar_idx)
{
const struct variable *ivar = iact->vars[ivar_idx];
const union value *val = case_data (c, ivar);
const struct variable *ivar = iact->vars[ivar_idx];
const union value *val = case_data (c, ivar);
-
- ds_put_cstr (&label, var_to_string (ivar));
- ds_put_cstr (&label, " = ");
- append_value_name (ivar, val, &label);
- ds_put_cstr (&label, "; ");
+ ds_init_empty (&l);
+
+ append_value_name (ivar, val, &l);
+ ds_ltrim (&l, ss_cstr (" "));
+
+ ds_put_substring (&label, l.ss);
+ if (ivar_idx < iact->n_vars - 1)
+ ds_put_cstr (&label, "; ");
+
+ ds_destroy (&l);
}
boxplot_add_box (boxplot, es[v].box_whisker, ds_cstr (&label));
}
boxplot_add_box (boxplot, es[v].box_whisker, ds_cstr (&label));