X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;ds=sidebyside;f=src%2Fbarchart.c;h=5c00d4f5c1954ad07a42f08f93709296db63179d;hb=1f8dd363d6c20d07fcca14cb948018465fa5ed8b;hp=e47a541ae0257dd087fd7f160a36d35f8b078cec;hpb=02ef5fef5288b80a4822e1006f6cb2b1369a55bd;p=pspp-builds.git diff --git a/src/barchart.c b/src/barchart.c index e47a541a..5c00d4f5 100644 --- a/src/barchart.c +++ b/src/barchart.c @@ -14,8 +14,8 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA - 02111-1307, USA. */ + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + 02110-1301, USA. */ #include @@ -89,7 +89,7 @@ static const char subcat_name[]="Gender"; struct subcat { const double *data; - char *label; + const char *label; }; static const struct subcat sub_catagory[SUB_CATAGORIES] = @@ -114,7 +114,6 @@ void draw_barchart(struct chart *ch, const char *title, const char *xlabel, const char *ylabel, enum bar_opts opt) { - double d; int i; @@ -122,11 +121,12 @@ draw_barchart(struct chart *ch, const char *title, double bar_width = interval_size / 1.1 ; + double ordinate_scale = fabs(ch->data_top - ch->data_bottom) / + fabs(y_max - y_min) ; + if ( opt != BAR_STACKED ) bar_width /= SUB_CATAGORIES; - double ordinate_scale = fabs(ch->data_top - ch->data_bottom) / fabs(y_max - y_min) ; - /* Move to data bottom-left */ pl_move_r(ch->lp, ch->data_left, ch->data_bottom);