{
struct chart_item chart_item;
+ /* Should the chart be displayed as percentages */
+ bool percent;
+
/* The categories */
struct freq **cats;
/* 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;
/* 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;
};
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);
\f
/* This boilerplate for barchart, a subclass of chart_item, was