GwyGraph: Gwyddion Widgets Library Reference Manual

## GwyGraph GwyGraph — Widget for displaying graphs |

## Functions

GtkWidget * | gwy_graph_new ()
GtkWidget * | gwy_graph_get_axis ()
void | gwy_graph_set_axis_visible ()
GtkWidget * | gwy_graph_get_area ()
void | gwy_graph_set_model ()
GwyGraphModel * | gwy_graph_get_model ()
void | gwy_graph_set_status ()
GwyGraphStatusType | gwy_graph_get_status ()
void | gwy_graph_enable_user_input ()

## Properties

GwyGraphModel * | model | Read / Write

## Types and Values

struct | GwyGraph
struct | GwyGraphClass

## Object Hierarchy

        GObject
        ╰── GInitiallyUnowned
            ╰── GtkWidget
                ╰── GtkContainer
                    ╰── GtkGrid
                        ╰── GwyGraph

## Implemented Interfaces

GwyGraph implements AtkImplementorIface, GtkBuildable and GtkOrientable.

## Includes

    #include <libgwyui/gwyui.h>

## Description

GwyGraph is a basic widget for displaying graphs. It consists of several widgets that can also be used separately (at least in principle): GwyGraphArea forms the main part of the graph, GwyGraphAxis is used for the axes, GwyGraphLabel represents the key and GwyGraphCorner is a dummy widget (at this moment) used for graph corners.

Persisent graph properties and data are represented with GwyGraphModel. Changes to the model are automatically reflected in the graph.

## Functions

### gwy_graph_new()

    GtkWidget *
    gwy_graph_new (GwyGraphModel *gmodel);

Creates graph widget based on information in model.

#### Parameters

gmodel | A graph model (may be `NULL`). |

#### Returns

new graph widget.

### gwy_graph_get_axis()

    GtkWidget *
    gwy_graph_get_axis (GwyGraph *graph,
                        GtkPositionType edge);

Gets a graph axis.

#### Parameters

graph | A graph widget. |
edge | Graph edge |

#### Returns

The axis (of given orientation) within the graph widget.

### gwy_graph_set_axis_visible()

    void
    gwy_graph_set_axis_visible (GwyGraph *graph,
                                GtkPositionType edge,
                                gboolean is_visible);

Sets the visibility of graph axis of given orientation.

#### Parameters

graph | A graph widget. |
edge | Graph edge |
is_visible | set/unset axis visibility within graph widget |

### gwy_graph_get_area()

    GtkWidget *
    gwy_graph_get_area (GwyGraph *graph);

Gets the area widget of a graph.

#### Parameters

graph | A graph widget. |

#### Returns

The graph area widget within the graph.

### gwy_graph_set_model()

    void
    gwy_graph_set_model (GwyGraph *graph,
                         GwyGraphModel *gmodel);

Changes the model a graph displays.

Everything in graph widgets will be reset to reflect the new data.

#### Parameters

graph | A graph widget. |
gmodel | New graph model |

### gwy_graph_get_model()

    GwyGraphModel *
    gwy_graph_get_model (GwyGraph *graph);

Gets the model of a graph.

#### Parameters

graph | A graph widget. |

#### Returns

The graph model this graph widget displays.

### gwy_graph_set_status()

    void
    gwy_graph_set_status (GwyGraph *graph,
                          GwyGraphStatusType status);

Sets the status of a graph widget.

The status determines how the graph reacts on mouse events. This includes point or area selection and zooming.

#### Parameters

graph | A graph widget. |
status | graph status |

### gwy_graph_get_status()

    GwyGraphStatusType
    gwy_graph_get_status (GwyGraph *graph);

Get the status of a graph widget.

See `gwy_graph_set_status()` for more.

#### Parameters

graph | A graph widget. |

#### Returns

The current graph status.

### gwy_graph_enable_user_input()

    void
    gwy_graph_enable_user_input (GwyGraph *graph,
                                 gboolean enable);

Enables/disables all the graph/curve settings dialogs to be invoked by mouse clicks.

#### Parameters

graph | A graph widget. |
enable | whether to enable user input |

## Types and Values

### struct GwyGraph

    struct GwyGraph;

### struct GwyGraphClass

    struct GwyGraphClass {
        GtkGridClass parent_class;

        void (*reserved1)(void);
        void (*reserved2)(void);
        void (*reserved3)(void);
        void (*reserved4)(void);
    };

## Property Details

### The `“model”` property

      “model”                    GwyGraphModel *

The graph model of the graph.

Owner: GwyGraph

Flags: Read / Write