- ds_init_string (&dst->label, &src->label);
- dst->magnitude = src->magnitude;
- }
- pie->n_slices = n_slices;
- return &pie->chart;
-}
-
-static void
-piechart_draw (const struct chart *chart, cairo_t *cr,
- struct chart_geometry *geom)
-{
- struct piechart *pie = (struct piechart *) chart;
- double total_magnitude;
- double left_label, right_label;
- double centre_x, centre_y;
- double radius;
- double angle;
- int i;
-
- centre_x = (geom->data_right + geom->data_left) / 2.0 ;
- centre_y = (geom->data_top + geom->data_bottom) / 2.0 ;
-
- left_label = geom->data_left + (geom->data_right - geom->data_left)/10.0;
- right_label = geom->data_right - (geom->data_right - geom->data_left)/10.0;
-
- radius = MIN (5.0 / 12.0 * (geom->data_top - geom->data_bottom),
- 1.0 / 4.0 * (geom->data_right - geom->data_left));
-
- radius = MIN (5.0 / 12.0 * (geom->data_top - geom->data_bottom),
- 1.0 / 4.0 * (geom->data_right - geom->data_left));
-
- chart_write_title (cr, geom, "%s", pie->title);
-
- total_magnitude = 0.0;
- for (i = 0; i < pie->n_slices; i++)
- total_magnitude += pie->slices[i].magnitude;