X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Foutput%2Fcharts%2Fbarchart.h;h=a9eb5812ac5b2a265b194cadb3f1d141c5adf411;hb=08959981d167390d9c9ba0ac5a8a2558de9175af;hp=dabf61b05036861d84b6307ab4fec151a3833ef6;hpb=97fb55e07cac602cbca57ce8005de5c8a67a73cc;p=pspp diff --git a/src/output/charts/barchart.h b/src/output/charts/barchart.h index dabf61b050..a9eb5812ac 100644 --- a/src/output/charts/barchart.h +++ b/src/output/charts/barchart.h @@ -29,6 +29,7 @@ struct category int idx; /* Unique zero based index */ struct string label; /* The label to be displayed for this category */ union value val; /* The value of this category */ + int width; /* The width of VAL */ }; @@ -36,6 +37,9 @@ struct barchart { struct chart_item chart_item; + /* Should the chart be displayed as percentages */ + bool percent; + /* The categories */ struct freq **cats; @@ -48,6 +52,9 @@ struct barchart /* The largest count of all the categories */ double largest; + /* The sum of all the counts */ + double total_count; + /* The label for the ordinate (vertical axis) */ char *ylabel; @@ -63,9 +70,8 @@ struct barchart /* A hash table of struct category indexed by VAL */ struct hmap secondaries; - - /* A array of pointers to the members of the above hmap, - sorted by VAL */ + /* A array of pointers to the members of the above hmap, + (the secondaries) sorted by VAL */ struct category **ss; }; @@ -74,7 +80,7 @@ struct variable; struct freq; struct chart_item *barchart_create (const struct variable **, int n_vars, - const char *ylabel, + const char *ylabel, bool percent, struct freq *const *, int n_cats); /* This boilerplate for barchart, a subclass of chart_item, was