From 76d65a89851d142dc58a34bee3123fcb9acba0c8 Mon Sep 17 00:00:00 2001 From: John Darrington Date: Mon, 19 Jan 2015 16:01:06 +0100 Subject: [PATCH] Piecharts: Remove trailing whitespace from slice labels --- src/output/charts/piechart.c | 5 +++++ 1 file changed, 5 insertions(+) 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; -- 2.30.2