From: John Darrington Date: Mon, 19 Jan 2015 15:01:06 +0000 (+0100) Subject: Piecharts: Remove trailing whitespace from slice labels X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?p=pspp;a=commitdiff_plain;h=76d65a89851d142dc58a34bee3123fcb9acba0c8 Piecharts: Remove trailing whitespace from slice labels --- diff --git a/src/output/charts/piechart.c b/src/output/charts/piechart.c index aac8bfbf8d..366e729e7c 100644 --- a/src/output/charts/piechart.c +++ b/src/output/charts/piechart.c @@ -43,6 +43,11 @@ piechart_create (const char *title, const struct slice *slices, int n_slices) struct slice *dst = &pie->slices[i]; ds_init_string (&dst->label, &src->label); + + /* Chomp any whitespace from the RHS of the label. + Doing this ensures that those labels to the right + of the pie, appear right justified. */ + ds_rtrim (&dst->label, ss_cstr (" \t")); dst->magnitude = src->magnitude; } pie->n_slices = n_slices;