+
+ int n_last_cat = 0;
+ for (i = 0; i < bc->n_nzcats; i++)
+ {
+ double height = geom->axis[SCALE_ORDINATE].scale * bc->cats[i]->count;
+
+ if (prev && !value_equal (prev, &bc->cats[i]->values[0], bc->widths[0]))
+ {
+ abscissa_label (bc, cr, geom, prev, x_pos, width, n_last_cat);
+
+ x_pos += width;
+ n_last_cat = 0;
+ }
+
+ cairo_rectangle (cr,
+ geom->axis[SCALE_ABSCISSA].data_min + x_pos,
+ geom->axis[SCALE_ORDINATE].data_min,
+ width, height);
+ cairo_save (cr);
+
+
+ int cidx = 0;
+ if (bc->ss)
+ {
+ struct category *foo;
+ size_t hash = value_hash (&bc->cats[i]->values[1], bc->widths[1], 0);
+ HMAP_FOR_EACH_WITH_HASH (foo, struct category, node, hash, &bc->secondaries)
+ {
+ if (value_equal (&foo->val, &bc->cats[i]->values[1], bc->widths[1]))
+ {
+ cidx = foo->idx;
+ break;
+ }
+ }
+ }
+
+ cairo_set_source_rgb (cr,
+ data_colour[cidx].red / 255.0,
+ data_colour[cidx].green / 255.0,
+ data_colour[cidx].blue / 255.0);
+ cairo_fill_preserve (cr);
+
+ cairo_restore (cr);
+ cairo_stroke (cr);
+
+ x_pos += width;
+
+ prev = &bc->cats[i]->values[0];
+ n_last_cat ++;
+ }
+
+ abscissa_label (bc, cr, geom, prev, x_pos, width, n_last_cat);