X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Foutput%2Fcharts%2Fbarchart-cairo.c;h=4663471e566e9c81b22ac0fb9d3bc3435d4e5a39;hb=010a024889199741ca697f95a34f8635f4ab2917;hp=ce97cdea6c173696d9256d0284d7404575f5475c;hpb=3dd0f6ae0d5eb73a2270a243e443c4ae03c2c16e;p=pspp diff --git a/src/output/charts/barchart-cairo.c b/src/output/charts/barchart-cairo.c index ce97cdea6c..4663471e56 100644 --- a/src/output/charts/barchart-cairo.c +++ b/src/output/charts/barchart-cairo.c @@ -56,21 +56,20 @@ abscissa_label (const struct barchart *bc, cairo_t *cr, void -xrchart_draw_barchart (const struct chart_item *chart_item, cairo_t *cr, +xrchart_draw_barchart (const struct chart *chart, cairo_t *cr, struct xrchart_geometry *geom) { - struct barchart *bc = to_barchart (chart_item); + struct barchart *bc = to_barchart (chart); int i; xrchart_write_title (cr, geom, _("Bar Chart")); xrchart_write_ylabel (cr, geom, bc->ylabel); - xrchart_write_xlabel (cr, geom, chart_item_get_title (chart_item)); + xrchart_write_xlabel (cr, geom, chart_get_title (chart)); - if (bc->percent) - xrchart_write_yscale (cr, geom, 0, bc->largest * 100.0 / bc->total_count ); - else - xrchart_write_yscale (cr, geom, 0, bc->largest); + if (! xrchart_write_yscale (cr, geom, 0, + bc->percent ? bc->largest * 100.0 / bc->total_count : bc->largest)) + return; const double abscale = geom->axis[SCALE_ABSCISSA].data_max - geom->axis[SCALE_ABSCISSA].data_min; const double width = abscale / (double) (bc->n_nzcats + bc->n_pcats);