#ifndef OUTPUT_CHART_PROVIDER_H
#define OUTPUT_CHART_PROVIDER_H 1
+#include <cairo/cairo.h>
#include <stdbool.h>
#include <stdint.h>
#include <output/chart.h>
uint8_t blue;
};
-struct chart_class
- {
- void (*draw) (const struct chart *, plPlotter *);
- void (*destroy) (struct chart *);
- };
-
-struct chart
- {
- const struct chart_class *class;
- int ref_cnt;
- };
-
-void chart_init (struct chart *, const struct chart_class *);
-bool chart_create_file (const char *type, const char *file_name_tmpl,
- int number, plPlotterParams *,
- char **file_namep, plPlotter **lpp);
-
/* The geometry of a chart. */
struct chart_geometry
{
int legend_left ;
int legend_right ;
- /* Default font size for the plot (if zero, then use plotter default) */
- int font_size;
+ /* Default font size for the plot. */
+ double font_size;
struct chart_colour fill_colour;
double y_max;
};
-void chart_geometry_init (plPlotter *, struct chart_geometry *);
-void chart_geometry_free (plPlotter *);
+struct chart_class
+ {
+ void (*draw) (const struct chart *, cairo_t *, struct chart_geometry *);
+ void (*destroy) (struct chart *);
+ };
+
+struct chart
+ {
+ const struct chart_class *class;
+ int ref_cnt;
+ };
+
+void chart_init (struct chart *, const struct chart_class *);
+
+void chart_geometry_init (cairo_t *, struct chart_geometry *,
+ double width, double length);
+void chart_geometry_free (cairo_t *);
+
+void chart_draw (const struct chart *, cairo_t *, struct chart_geometry *);
+char *chart_draw_png (const struct chart *, const char *file_name_template,
+ int number);
#endif /* output/chart-provider.h */