From: Ben Pfaff Date: Thu, 2 Jul 2009 02:29:49 +0000 (-0700) Subject: piechart: Change 'angle' variable from static to automatic. X-Git-Tag: v0.7.3~13 X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3e00bf39cb0bc318bc2071e0b717ac893033150d;p=pspp-builds.git piechart: Change 'angle' variable from static to automatic. --- diff --git a/src/output/charts/piechart.c b/src/output/charts/piechart.c index 5ff6123b..869f21b2 100644 --- a/src/output/charts/piechart.c +++ b/src/output/charts/piechart.c @@ -1,5 +1,5 @@ /* PSPP - a program for statistical analysis. - Copyright (C) 2004 Free Software Foundation, Inc. + Copyright (C) 2004, 2009 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 @@ -66,16 +66,17 @@ piechart_plot(const char *title, const struct slice *slices, int n_slices) 1.0 / 4.0 * (ch->data_right - ch->data_left) ); + double angle; + chart_write_title(ch, title); for (i = 0 ; i < n_slices ; ++i ) total_magnitude += slices[i].magnitude; + angle = 0.0; for (i = 0 ; i < n_slices ; ++i ) { - static double angle=0.0; - const double segment_angle = slices[i].magnitude / total_magnitude * 2 * M_PI ;