GtkDataboxGraph

## GtkDataboxGraph GtkDataboxGraph — An abstract anchestor for all "real" graphs. |

## Synopsis

    #include <gtkdatabox_graph.h>

                        GtkDataboxGraphPrivate;
                        GtkDataboxGraph;
    GdkGC*              gtk_databox_graph_get_gc            (GtkDataboxGraph *graph);
    void                gtk_databox_graph_set_gc            (GtkDataboxGraph *graph,
                                                             GdkGC *gc);
    void                gtk_databox_graph_set_hide          (GtkDataboxGraph *graph,
                                                             gboolean hide);
    gboolean            gtk_databox_graph_get_hide          (GtkDataboxGraph *graph);
    void                gtk_databox_graph_set_color         (GtkDataboxGraph *graph,
                                                             GdkColor *color);
    GdkColor*           gtk_databox_graph_get_color         (GtkDataboxGraph *graph);
    void                gtk_databox_graph_set_size          (GtkDataboxGraph *graph,
                                                             gint size);
    gint                gtk_databox_graph_get_size          (GtkDataboxGraph *graph);
    gint                gtk_databox_graph_calculate_extrema (GtkDataboxGraph *graph,
                                                             gfloat *min_x,
                                                             gfloat *max_x,
                                                             gfloat *min_y,
                                                             gfloat *max_y);
    void                gtk_databox_graph_draw              (GtkDataboxGraph *graph,
                                                             GtkDatabox *box);
    GdkGC*              gtk_databox_graph_create_gc         (GtkDataboxGraph *graph,
                                                             GtkDatabox *box);

## Object Hierarchy

      GObject
       +----GtkDataboxGraph
             +----GtkDataboxXYCGraph
             +----GtkDataboxGrid

## Properties

      "color"                    gpointer              : Read / Write
      "hide"                     gboolean              : Read / Write
      "size"                     gint                  : Read / Write

## Description

GtkDataboxGraphs can display data or other things in a GtkDatabox widget.

This class is just the basic interface. Other graph classes are derived from this class and implement some real things.

## Details

### GtkDataboxGraphPrivate

    typedef struct _GtkDataboxGraphPrivate GtkDataboxGraphPrivate;

A private data structure used by the GtkDataboxGraph. It shields all internal things from developers who are just using the object.

### GtkDataboxGraph

    typedef struct _GtkDataboxGraph GtkDataboxGraph;

The GtkDataboxGraph is the base class for all kinds of graphs (e.g. lines, points, decorations like coordinate crosses) to be shown in a GtkDatabox wiget.

Implemented by _GtkDataboxGraph

### gtk_databox_graph_get_gc ()

    GdkGC*              gtk_databox_graph_get_gc            (GtkDataboxGraph *graph);

Gets the current graphics context of the graph.

`graph` : | A GtkDataboxGraph object
Returns : | The current graphics context of the graph.

### gtk_databox_graph_set_gc ()

    void                gtk_databox_graph_set_gc            (GtkDataboxGraph *graph,
                                                             GdkGC *gc);

Sets the graphics context which the GtkDataboxGraph object is supposed to be using when drawing itself.

`graph` : | A GtkDataboxGraph object
`gc` : | Graphics contex for the graph object

### gtk_databox_graph_set_hide ()

    void                gtk_databox_graph_set_hide          (GtkDataboxGraph *graph,
                                                             gboolean hide);

Hidden graphs are not shown, when the GtkDatabox containing them is redrawn.

`graph` : | A GtkDataboxGraph object
`hide` : | Declares whether should be hidden (true) or not (false).

### gtk_databox_graph_get_hide ()

    gboolean            gtk_databox_graph_get_hide          (GtkDataboxGraph *graph);

Gets the current "hide" status.

`graph` : | A GtkDataboxGraph object
Returns : | Whether the graph is hidden (true) or not (false).

### gtk_databox_graph_set_color ()

    void                gtk_databox_graph_set_color         (GtkDataboxGraph *graph,
                                                             GdkColor *color);

Sets the color which the GtkDataboxGraph object is supposed to be using when drawing itself.

`graph` : | A GtkDataboxGraph object
`color` : | Color which is to be used by the graph object

### gtk_databox_graph_get_color ()

    GdkColor*           gtk_databox_graph_get_color         (GtkDataboxGraph *graph);

Gets the current color of the graph elements (e.g. points).

`graph` : | A GtkDataboxGraph object
Returns : | The color of the graph.

### gtk_databox_graph_set_size ()

    void                gtk_databox_graph_set_size          (GtkDataboxGraph *graph,
                                                             gint size);

Sets the size (e.g. line width) which the GtkDataboxGraph object is supposed to be using when drawing itself.

`graph` : | A GtkDataboxGraph object
`size` : | Size of graph elements for the graph object

### gtk_databox_graph_get_size ()

    gint                gtk_databox_graph_get_size          (GtkDataboxGraph *graph);

Gets the size of the graph elements (e.g. the line width).

`graph` : | A GtkDataboxGraph object
Returns : | size of the graph elements

### gtk_databox_graph_calculate_extrema ()

    gint                gtk_databox_graph_calculate_extrema (GtkDataboxGraph *graph,
                                                             gfloat *min_x,
                                                             gfloat *max_x,
                                                             gfloat *min_y,
                                                             gfloat *max_y);

Virtual function which determines the minimum and maximum x and y values of the values of this GtkDataboxGraph object if applicable (there are graphs which do not contain data).

`graph` : | A GtkDataboxGraph object
`min_x` : | Will be filled with the lowest x value of the dataset
`max_x` : | Will be filled with the highest x value of the dataset
`min_y` : | Will be filled with the lowest y value of the dataset
`max_y` : | Will be filled with the highest y value of the dataset
Returns : | 0 on success, -1 if no data is available,

### gtk_databox_graph_draw ()

    void                gtk_databox_graph_draw              (GtkDataboxGraph *graph,
                                                             GtkDatabox *box);

Virtual function which draws the GtkDataboxGraph on the drawing area of the GtkDatabox object.

Typically this function is called by GtkDatabox objects.

`graph` : | A GtkDataboxGraph object
`box` : | A GtkDatabox object

### gtk_databox_graph_create_gc ()

    GdkGC*              gtk_databox_graph_create_gc         (GtkDataboxGraph *graph,
                                                             GtkDatabox *box);

Virtual function which creates a graphics context for the `graph`.

Typically called by derived graph objects when the graphics context is needed for the first time.

`graph` : | A GtkDataboxGraph object
`box` : | A GtkDatabox object
Returns : | The new graphics context.

## Property Details

### The `"color"` property

      "color"                    gpointer              : Read / Write

Color of graph.

### The `"hide"` property

      "hide"                     gboolean              : Read / Write

Determine if graph is hidden or not.

Default value: FALSE

### The `"size"` property

      "size"                     gint                  : Read / Write

Size of displayed items.

Default value: 0

## See Also

GtkDatabox, GtkDataboxPoints, GtkDataboxLines, GtkDataboxBars, GtkDataboxGrid, GtkDataboxCrossSimple