From 571a1c6fa3b068837f98dcf3ad98d69753fd7634 Mon Sep 17 00:00:00 2001 From: John Darrington Date: Fri, 28 May 2010 13:49:43 +0200 Subject: [PATCH] Fix inconsistent label positions on piecharts. The labels of piechart slices did not match the positions of the slices (possibly due to libplot legacy). This change fixes this problem. --- src/output/charts/piechart-cairo.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/output/charts/piechart-cairo.c b/src/output/charts/piechart-cairo.c index 501c0bd4..3917e4e1 100644 --- a/src/output/charts/piechart-cairo.c +++ b/src/output/charts/piechart-cairo.c @@ -81,11 +81,11 @@ xrchart_draw_piechart (const struct chart_item *chart_item, cairo_t *cr, const double segment_angle = pie->slices[i].magnitude / total_magnitude * 2 * M_PI ; - const double label_x = centre_x - - radius * sin(angle + segment_angle/2.0); + const double label_x = centre_x + + radius * cos (angle + segment_angle/2.0); const double label_y = centre_y + - radius * cos(angle + segment_angle/2.0); + radius * sin (angle + segment_angle/2.0); /* Fill the segment */ draw_segment (cr, -- 2.30.2