## GOGraphWidget GOGraphWidget — Widget showing a GogGraph. |

## Synopsis

                        GOGraphWidget;
                        GOGraphWidgetClass;
    enum                GOGraphWidgetSizeMode;
    GogChart *          go_graph_widget_get_chart           (GOGraphWidget *widget);
    GogGraph *          go_graph_widget_get_graph           (GOGraphWidget *widget);
    GogRenderer *       go_graph_widget_get_renderer        (GOGraphWidget *widget);
    GtkWidget *         go_graph_widget_new                 (GogGraph *graph);
    void                go_graph_widget_set_size_mode       (GOGraphWidget *widget,
                                                             GOGraphWidgetSizeMode size_mode,
                                                             int width,
                                                             int height);

## Object Hierarchy

      GObject
       +----GInitiallyUnowned
             +----GtkWidget
                   +----GtkContainer
                         +----GtkLayout
                               +----GOGraphWidget

## Implemented Interfaces

GOGraphWidget implements AtkImplementorIface, GtkBuildable and GtkScrollable.

## Properties

      "aspect-ratio"             gdouble               : Read / Write / Construct
      "graph"                    GogGraph*             : Read / Write / Construct Only
      "hres"                     gdouble               : Read / Write / Construct Only
      "vres"                     gdouble               : Read / Write / Construct Only

## Description

Utility widget for showing a GogGraph.

## Details

### GOGraphWidget

    typedef struct _GOGraphWidget GOGraphWidget;

### GOGraphWidgetClass

    typedef struct _GOGraphWidgetClass GOGraphWidgetClass;

### enum GOGraphWidgetSizeMode

    typedef enum {
    	GO_GRAPH_WIDGET_SIZE_MODE_FIT = 0,
    	GO_GRAPH_WIDGET_SIZE_MODE_FIT_WIDTH,
    	GO_GRAPH_WIDGET_SIZE_MODE_FIT_HEIGHT,
    	GO_GRAPH_WIDGET_SIZE_MODE_FIXED_SIZE
    } GOGraphWidgetSizeMode;

`GO_GRAPH_WIDGET_SIZE_MODE_FIT` | fits the allocated size, conserving the aspect ratio.
`GO_GRAPH_WIDGET_SIZE_MODE_FIT_WIDTH` | fits the width, conserving the aspect ratio.
`GO_GRAPH_WIDGET_SIZE_MODE_FIT_HEIGHT` | fits the width, conserving the aspect ratio.
`GO_GRAPH_WIDGET_SIZE_MODE_FIXED_SIZE` | use original size.

### go_graph_widget_get_chart ()

    GogChart *          go_graph_widget_get_chart           (GOGraphWidget *widget);

`widget` : | GOGraphWidget
Returns : | the GogChart created by `go_graph_widget_new()`. [transfer none]

### go_graph_widget_get_graph ()

    GogGraph *          go_graph_widget_get_graph           (GOGraphWidget *widget);

`widget` : | GOGraphWidget
Returns : | the GogGraph embedded in the widget. [transfer none]

### go_graph_widget_get_renderer ()

    GogRenderer *       go_graph_widget_get_renderer        (GOGraphWidget *widget);

`widget` : | GOGraphWidget
Returns : | the GogRenderer used by the widget. [transfer none]

### go_graph_widget_new ()

    GtkWidget *         go_graph_widget_new                 (GogGraph *graph);

Creates a new GOGraphWidget with an embedded GogGraph. If graph is NULL, the graph will be auto-created, and a GogChart will be added graph.

`graph` : | GogGraph
Returns : | the newly created GOGraphWidget.

### go_graph_widget_set_size_mode ()

    void                go_graph_widget_set_size_mode       (GOGraphWidget *widget,
                                                             GOGraphWidgetSizeMode size_mode,
                                                             int width,
                                                             int height);

Sets the size mode of the GOGraphWidget. It is used to determine the size and position of the drawn chart. The following sizing modes are supported:

GO_GRAPH_WIDGET_SIZE_MODE_FIT, aspect ratio set. The aspect ratio is guaranteed to be maintained, i.e. the graph is never squeezed, and will always fit into the visible area.

GO_GRAPH_WIDGET_SIZE_MODE_FIT, no aspect ratio set. The aspect ratio is adapted to make the graph exactly fit into the visible area.

GO_GRAPH_WIDGET_SIZE_MODE_FIT_WIDTH, aspect ratio set. The aspect ratio is guaranteed to be maintained, i.e. the graph is never squezzed, and will always occupy the whole width of the visible area.

GO_GRAPH_WIDGET_SIZE_MODE_FIT_HEIGHT, aspect ratio set. The aspect ratio is guaranteed to be maintained, i.e. the graph is never squezzed, and will always occupy the whole height of the visible area.

GO_GRAPH_WIDGET_SIZE_MODE_FIT_FIXED_SIZE, no aspect ratio set. The graph will occupy the area specified by width/height, its aspect ratio will be determined by height/width.

`widget` : | GOGraphWidget
`size_mode` : | GOGraphWidgetSizeMode
`width` : | in pixels
`height` : | in pixels

## Property Details

### The `"aspect-ratio"` property

      "aspect-ratio"             gdouble               : Read / Write / Construct

Aspect ratio for rendering the graph, used only if greater than 0.

Default value: -1

### The `"graph"` property

      "graph"                    GogGraph*             : Read / Write / Construct Only

The graph to render.

### The `"hres"` property

      "hres"                     gdouble               : Read / Write / Construct Only

Assumed horizontal screen resolution in pixels per inch.

Allowed values: >= 1

Default value: 96

### The `"vres"` property

      "vres"                     gdouble               : Read / Write / Construct Only

Assumed vertical screen resolution in pixels per inch.

Allowed values: >= 1

Default value: 96