- /* Set default chartetry */
- chart->data_top = 900;
- chart->data_right = 800;
- chart->data_bottom = 120;
- chart->data_left = 150;
- chart->abscissa_top = 70;
- chart->ordinate_right = 120;
- chart->title_bottom = 920;
- chart->legend_left = 810;
- chart->legend_right = 1000;
- chart->font_size = 0;
- strcpy(chart->fill_colour,"red");
+ A chart is abstract, that is, a plain chart is not useful on its own. Thus,
+ this function is normally called from the initialization function of some
+ subclass of chart. */
+void
+chart_init (struct chart *chart, const struct chart_class *class,
+ const char *title)
+{
+ *chart = (struct chart) {
+ .ref_cnt = 1,
+ .class = class,
+ .title = xstrdup_if_nonnull (title),
+ };
+}