geom->title_bottom = 0.920 * length;
geom->legend_left = 0.810 * width;
geom->legend_right = width;
- geom->font_size = 10;
+ geom->font_size = 15.0;
+ geom->in_path = false;
+ geom->dataset = NULL;
+ geom->n_datasets = 0;
geom->fill_colour.red = 255;
geom->fill_colour.green = 0;
}
void
-chart_geometry_free (cairo_t *cr UNUSED)
+chart_geometry_free (cairo_t *cr UNUSED, struct chart_geometry *geom)
{
+ int i;
+
+ for (i = 0 ; i < geom->n_datasets; ++i)
+ free (geom->dataset[i]);
+ free (geom->dataset);
}
void
chart_geometry_init (cr, &geom, width, length);
chart_draw (chart, cr, &geom);
- chart_geometry_free (cr);
+ chart_geometry_free (cr, &geom);
status = cairo_surface_write_to_png (surface, file_name);
if (status != CAIRO_STATUS_SUCCESS)
struct chart *
chart_ref (const struct chart *chart_)
{
- struct chart *chart = (struct chart *) chart_;
+ struct chart *chart = CONST_CAST (struct chart *, chart_);
chart->ref_cnt++;
return chart;
}