* Now wit hlabels and line drawing!
[scdataviz] / graph.h
diff --git a/graph.h b/graph.h
index 33112a5..3015d30 100644 (file)
--- a/graph.h
+++ b/graph.h
 
 typedef enum {SQUARE, CIRCLE, STAR, PLUS, MINUS, CROSS} graph_symbol;
 
+struct graph_point {
+  double x;
+  double y;
+  GString *label;
+  /*the Bezier control point FROM HERE to the next point (P1)*/
+  double bezier_from_x;
+  double bezier_from_y;
+  /*the Bezier control point from previous point TO HERE (P2)*/
+  double bezier_to_x;
+  double bezier_to_y;
+};
+
 typedef struct _Graph {
   GObject parent_instance;
   /*Array of n_points sets of x,y coords*/
   GPtrArray *points;
+  /*If you want to, this will override the lines between the points.*/
+  GPtrArray *lines;
   double maxx;
   double minx;
   double maxy;
@@ -54,6 +68,7 @@ typedef struct _GraphClass {
 #define GRAPH_GET_CLASS (G_TYPE_INSTANCE_GET_CLASS ((obj), GRAPH, GraphClass))
 
 Graph *graph_new(void);
-int graph_add_point(Graph* graph, double x, double y);
+int graph_add_point(Graph* graph, double x, double y, const GString *label);
+int graph_add_graph_point(Graph* graph, struct graph_point *pt);
 
 #endif             /* !GRAPHCLASS_H_ */