| GOffice Reference Manual | ||||
|---|---|---|---|---|
| Top | Description | Object Hierarchy | Implemented Interfaces | Properties | Signals | ||||
GogGraph; GogGraphClass; GogGraphView; GogGraph * gog_graph_dup (GogGraph const *graph); gboolean gog_graph_export_image (GogGraph *graph,GOImageFormat format,GsfOutput *output,double x_dpi,double y_dpi); void gog_graph_force_update (GogGraph *graph); GSList * gog_graph_get_data (GogGraph const *graph); GODoc * gog_graph_get_document (GogGraph *graph); void gog_graph_get_size (GogGraph *graph,double *width,double *height); GSList * gog_graph_get_supported_image_formats (void); GogTheme * gog_graph_get_theme (GogGraph const *graph); unsigned gog_graph_num_cols (GogGraph const *graph); unsigned gog_graph_num_rows (GogGraph const *graph); gboolean gog_graph_request_update (GogGraph *graph); GOData * gog_graph_ref_data (GogGraph *graph,GOData *dat); void gog_graph_render_to_cairo (GogGraph *graph,cairo_t *cairo,double w,double h); void gog_graph_set_size (GogGraph *graph,double width,double height); void gog_graph_set_theme (GogGraph *graph,GogTheme *theme); void gog_graph_unref_data (GogGraph *graph,GOData *dat); gboolean gog_graph_validate_chart_layout (GogGraph *graph); GogView * gog_graph_view_get_selection (GogGraphView *gview); void gog_graph_view_handle_event (GogGraphView *gview,GdkEvent *event,double x_offset,double y_offset); void gog_graph_view_set_selection (GogGraphView *gview,GogObject *gobj);
GObject +----GogObject +----GogStyledObject +----GogOutlinedObject +----GogGraph
GObject +----GogView +----GogOutlinedView +----GogGraphView
"document" GODoc* : Read / Write "height-pts" gdouble : Read / Write "theme" GogTheme* : Read / Write "theme-name" gchar* : Read / Write "width-pts" gdouble : Read / Write "renderer" GogRenderer* : Write
A graph (in the abstract sense) in GOffice is an hierarical object model, with a GogGraph object as the top-level object. Objects that can be part of a graph is a subclass of GogObject. Those, and related objects have the prefix "Gog" in the class name. See GogObject for how to manipulate the object model, and the individual classes for specifics.
A GogGraph can have 1 or more children in the roles "Chart" and "Title".
typedef struct {
GogOutlinedObjectClass base;
/* signals */
void (*add_data) (GogGraph *graph, GOData *input);
void (*remove_data) (GogGraph *graph, GOData *input);
} GogGraphClass;
GogOutlinedObjectClass |
base class. |
GogGraph * gog_graph_dup (GogGraph const *graph);
|
GogGraph |
Returns : |
a deep copy of graph. [transfer full]
|
gboolean gog_graph_export_image (GogGraph *graph,GOImageFormat format,GsfOutput *output,double x_dpi,double y_dpi);
Exports an image of graph in given format, writing results in a GsfOutput stream.
If export format type is a bitmap one, it computes image size with x_dpi, y_dpi and
graph size (see ).
gog_graph_get_size()
void gog_graph_force_update (GogGraph *graph);
Do an update now if one has been queued.
|
GogGraph |
GSList * gog_graph_get_data (GogGraph const *graph);
|
GogGraph |
Returns : |
a list of the GOData objects that are data to the graph. The caller should _not_ modify or free the list. [element-type GOData][transfer none] |
GODoc * gog_graph_get_document (GogGraph *graph);
Retrieves the GODoc for graph.
|
a GogGraph |
Returns : |
the document. [transfer none] |
void gog_graph_get_size (GogGraph *graph,double *width,double *height);
FIXME Returns the logical size of graph, in points.
|
GogGraph |
|
logical width in pts |
|
logical height in pts |
GSList * gog_graph_get_supported_image_formats
(void);
Builds a list of supported formats for image export.
Returns : |
a GSList of GOImageFormat. [element-type GOImageFormat][transfer container] |
gboolean gog_graph_request_update (GogGraph *graph);
queue an update if one had not already be queued.
|
GogGraph |
Returns : |
TRUE if a handler has been added. |
void gog_graph_render_to_cairo (GogGraph *graph,cairo_t *cairo,double w,double h);
Renders a graph using cairo. w and h are the requested width an height of the rendered graph, in the current cairo coordinate space. This function is not suited for multiple rendering of the same graph. gog_renderer_render_to cairo or gog_renderer_update/gog_renderer_get_cairo_surface should be used instead.
|
a GogGraph |
|
a cairo context |
|
width |
|
height |
void gog_graph_set_size (GogGraph *graph,double width,double height);
Sets the logical size of graph, given in points.
|
GogGraph |
|
logical width in pts |
|
logical height in pts |
gboolean gog_graph_validate_chart_layout (GogGraph *graph);
Check the layout of the chart grid and ensure that there are no empty cols or rows, and resize as necessary
|
GogGraph |
Returns : |
TRUE if anything changed. |
GogView * gog_graph_view_get_selection (GogGraphView *gview);
|
GogGraphView |
Returns : |
current selected view. [transfer none] |
void gog_graph_view_handle_event (GogGraphView *gview,GdkEvent *event,double x_offset,double y_offset);
Handle events.
|
GogGraphView |
|
GdkEvent |
|
in pixels |
|
in pixels |
void gog_graph_view_set_selection (GogGraphView *gview,GogObject *gobj);
Sets gobj as current selection. If gobj is different from previously
selected object, a selection-changed signal is emitted.
|
GogGraphView |
|
new selected object |
"height-pts" property "height-pts" gdouble : Read / Write
Logical graph height, in points.
Allowed values: >= 0
Default value: 226.772
"theme-name" property "theme-name" gchar* : Read / Write
The name of the theme for elements of the graph.
Default value: "default"
"width-pts" property "width-pts" gdouble : Read / Write
Logical graph width, in points.
Allowed values: >= 0
Default value: 340.157
"add-data" signalvoid user_function (GogGraph *graph,
GObject *data,
gpointer user_data) : Run Last
The ::add-data signal is emitted BEFORE data has been added.
|
the object on which the signal is emitted |
|
The new GOData being added to graph
|
|
user data set when the signal handler was connected. |
"remove-data" signalvoid user_function (GogGraph *graph,
GObject *data,
gpointer user_data) : Run Last
The ::remove-data signal is emitted BEFORE data has been removed.
|
the object on which the signal is emitted |
|
The new GOData being removed to graph
|
|
user data set when the signal handler was connected. |
"selection-changed" signalvoid user_function (GogGraphView *goggraphview,
GObject *arg1,
gpointer user_data) : Run Last
|
the object which received the signal. |
|
user data set when the signal handler was connected. |