X-Git-Url: http://git.maemo.org/git/?p=scdataviz;a=blobdiff_plain;f=graph.h;h=31d441f9e093175f424536635e8eddf15fdc3f58;hp=68aa97bb2bae94dc6b6367b83b0cae881c120f42;hb=900c1116fbd1f53ae56397cfe84c9c13a295768c;hpb=2329e96577a27c47e5287118d8808542fbed12ec diff --git a/graph.h b/graph.h index 68aa97b..31d441f 100644 --- a/graph.h +++ b/graph.h @@ -52,6 +52,15 @@ struct graph_line { double p3_y; }; +struct graph_axis { + double major_start; + double major_step; + int major; + int minor; + int subminor; + GString *title; +}; + typedef struct _Graph { GObject parent_instance; /*Array of n_points sets of x,y coords*/ @@ -63,6 +72,8 @@ typedef struct _Graph { double maxy; double miny; graph_symbol symbol; + struct graph_axis *xaxis; + struct graph_axis *yaxis; } Graph; typedef struct _GraphClass { @@ -80,11 +91,16 @@ Graph *graph_new(void); int graph_add_point(Graph* graph, double x, double y, const GString *label); int graph_add_graph_point(Graph* graph, struct graph_point *pt); int graph_add_line(Graph* graph, double p0_x, double p0_y, double p1_x, double p1_y, double p2_x, double p2_y, double p3_x, double p3_y); +int graph_add_graph_line(Graph* graph, struct graph_line *l); void graph_add_linear_connectors(Graph* graph); /*Provide x0, x3; x1 and x2 will be set*/ void graph_bezier_linear_to_cubic(double x0, double x3, double *x1, double *x2); /*Provide x0, x1, x2. x1 and x2 will be set appropriately.*/ -void graph_bezier_qudratic_to_cubic(double x0, double x3, double *x1, double *x2); +void graph_bezier_quadratic_to_cubic(double x0, double x3, double *x1, double *x2); +void graph_set_xaxis(Graph *g, struct graph_axis *axis); +void graph_set_yaxis(Graph *g, struct graph_axis *axis); +int graph_autoset_xaxis(Graph *g, GString *title); +int graph_autoset_yaxis(Graph *g, GString *title);