| GOffice Reference Manual | ||||
|---|---|---|---|---|
| Top | Description | Object Hierarchy | Properties | ||||
GogPlot; GogPlotClass; GogPlotDesc; GogPlotView; GogPlotViewClass; #define GOG_PLOT_GET_CLASS (o) GogPlotBoundInfo; void gog_plot_axis_clear (GogPlot *plot,GogAxisSet filter); gboolean gog_plot_axis_set_assign (GogPlot *plot,GogAxisSet type); gboolean gog_plot_axis_set_is_valid (GogPlot const *plot,GogAxisSet type); GogAxisSet gog_plot_axis_set_pref (GogPlot const *plot); void gog_plot_clear_series (GogPlot *plot); GogPlotDesc const * gog_plot_description (GogPlot const *plot); void gog_plot_foreach_elem (GogPlot *plot,gboolean only_visible,GogEnumFunc handler,gpointer data); GogAxis * gog_plot_get_axis (GogPlot const *plot,GogAxisType type); GOData * gog_plot_get_axis_bounds (GogPlot *plot,GogAxisType axis,GogPlotBoundInfo *bounds); void gog_plot_get_cardinality (GogPlot *plot,unsigned *full,unsigned *visible); double gog_plot_get_percent_value (GogPlot *plot,unsigned series,unsigned index); GSList const * gog_plot_get_series (GogPlot const *plot); void gog_plot_guru_helper (GogPlot *plot); GogPlot * gog_plot_new_by_name (char const *id); GogPlot * gog_plot_new_by_type (GogPlotType const *type); GogSeries * gog_plot_new_series (GogPlot *plot); void gog_plot_request_cardinality_update (GogPlot *plot); void gog_plot_set_axis (GogPlot *plot,GogAxis *axis); gboolean gog_plot_supports_vary_style_by_element (GogPlot const *plot); void gog_plot_update_3d (GogPlot *plot); void gog_plot_update_cardinality (GogPlot *plot,int index_num); int gog_plot_view_get_data_at_point (GogPlotView *view,double x,double y,GogSeries **series);
"bubble-axis" guint : Read / Write "circ-axis" guint : Read / Write "color-axis" guint : Read / Write "guru-hints" gchar* : Read / Write "interpolation" gchar* : Read / Write "plot-group" gchar* : Read / Write "pseudo-3d-axis" guint : Read / Write "radial-axis" guint : Read / Write "vary-style-by-element" gboolean : Read / Write "x-axis" guint : Read / Write "y-axis" guint : Read / Write "z-axis" guint : Read / Write
This is the object that visualizes data.
To manipulate the data shown in the plot, use gog_plot_new_series() and
gog_plot_clear_series()
Plots are implemented as plug-ins, so make sure the plug-in system is
initialized before trying to create one. See go_plugins_init()
GOffice ships a number of common plot implementations by default.
typedef struct {
GogObjectClass base;
GogPlotDesc desc;
GType series_type;
GogAxisSet axis_set;
/* Virtuals */
GOData *(*axis_get_bounds) (GogPlot *plot, GogAxisType axis,
GogPlotBoundInfo *bounds);
gboolean (*supports_vary_style_by_element) (GogPlot const *plot);
/* %TRUE if the plot prefers to display series in reverse order for
* legends (e.g. stacked plots want top element to be the last series) */
gboolean (*enum_in_reverse) (GogPlot const *plot);
void (*foreach_elem) (GogPlot *plot, gboolean only_visible,
GogEnumFunc handler, gpointer data);
void (*update_3d) (GogPlot *plot);
void (*guru_helper) (GogPlot *plot, char const *hint);
double (*get_percent) (GogPlot *plot, unsigned series, unsigned index);
} GogPlotClass;
GogObjectClass |
|
GogPlotDesc |
GogPlotDesc |
| series type. | |
GogAxisSet |
set of use axes. |
| requests the axis bounds | |
TRUE if each element has its own style. |
|
TRUE if the plot prefers to display series in reverse
order for legends (e.g. stacked plots want top element to be the
last series. |
|
| enumerates the elements visible in the legend. | |
| updates 3D (and contour) plots. | |
| customizes a new plot in the graph editor dialog. | |
| get the value as a percentage. |
typedef struct {
unsigned num_series_max;
GogSeriesDesc series;
} GogPlotDesc;
GogSeriesDesc |
series description. |
typedef struct {
GogViewClass base;
int (*get_data_at_point) (GogPlotView *view, double x, double y, GogSeries **series);
} GogPlotViewClass;
GogViewClass |
|
| returns the data index at the given position, -1 if none. |
#define GOG_PLOT_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GOG_TYPE_PLOT, GogPlotClass))
typedef struct {
struct _GogPlotBound {
double minima, maxima;
} val, logical;
gboolean is_discrete;
gboolean center_on_ticks;
GOFormat *fmt;
const GODateConventions *date_conv;
} GogPlotBoundInfo;
Used by plots to give formating informations to each axis. GogPlotBoundInfo::val are the values limits, GogPlotBoundInfo::logical are the actual needed display limits.
| whether the data are discrete. | |
| whether to center data on ticks. | |
GOFormat * |
GOFormat to use. |
const GODateConventions * |
the used GODateConventions. |
void gog_plot_axis_clear (GogPlot *plot,GogAxisSet filter);
A utility method to clear all existing axis associations flagged by filter
|
GogPlot |
|
GogAxisSet |
gboolean gog_plot_axis_set_is_valid (GogPlot const *plot,GogAxisSet type);
GogPlotDesc const * gog_plot_description (GogPlot const *plot);
|
GogPlot |
Returns : |
the GogPlotDesc for plot. [transfer none]
|
void gog_plot_foreach_elem (GogPlot *plot,gboolean only_visible,GogEnumFunc handler,gpointer data);
Executes funcfor each plot element. Used to build a legend.
|
GogPlot |
|
whether to restrict to visible elements. |
|
GogEnumFunc. [scope call] |
|
user data for func
|
GogAxis * gog_plot_get_axis (GogPlot const *plot,GogAxisType type);
|
GogPlot |
|
GogAxisType |
Returns : |
the axis if any. [transfer none] |
GOData * gog_plot_get_axis_bounds (GogPlot *plot,GogAxisType axis,GogPlotBoundInfo *bounds);
Queries plot for its axis preferences for axis and stores the results in
bounds. All elements of bounds are initialized to sane values before the
query _EXCEPT_ ::fmt. The caller is responsible for initializing it. This
is done so that once on plot has selected a format the others need not do
the lookup too if so desired.
Caller is responsible for unrefing ::fmt.
|
GogPlot |
|
GogAxisType |
|
GogPlotBoundInfo |
Returns : |
The data providing the bound (does not add a ref). [transfer none] |
void gog_plot_get_cardinality (GogPlot *plot,unsigned *full,unsigned *visible);
Return the number of logical elements in the plot.
See gog_chart_get_cardinality.
full and visible may be NULL.
|
GogPlot |
|
placeholder for full cardinality |
|
placeholder for visible cardinality |
double gog_plot_get_percent_value (GogPlot *plot,unsigned series,unsigned index);
GSList const * gog_plot_get_series (GogPlot const *plot);
|
GogPlot |
Returns : |
(transfer none) (element-type GogSeries) : A list of the series in plot. Do not modify or free the list. |
GogSeries * gog_plot_new_series (GogPlot *plot);
|
GogPlot |
Returns : |
a new GogSeries of a type consistent with plot. [transfer none]
|
gboolean gog_plot_supports_vary_style_by_element
(GogPlot const *plot);
void gog_plot_update_cardinality (GogPlot *plot,int index_num);
Update cardinality and cache result. See gog_chart_get_cardinality.
|
GogPlot |
|
index offset for this plot |
int gog_plot_view_get_data_at_point (GogPlotView *view,double x,double y,GogSeries **series);
Search a data represented at (x,y) in view and set series on success.
|
GogPlotView |
|
x position |
|
y position |
|
where to store the series |
Returns : |
index of the found data in series or -1. |
"bubble-axis" property "bubble-axis" guint : Read / Write
Reference to bubble axis.
Allowed values: <= G_MAXINT
Default value: 0
"circ-axis" property "circ-axis" guint : Read / Write
Reference to circular axis.
Allowed values: <= G_MAXINT
Default value: 0
"color-axis" property "color-axis" guint : Read / Write
Reference to color axis.
Allowed values: <= G_MAXINT
Default value: 0
"guru-hints" property "guru-hints" gchar* : Read / Write
Semicolon separated list of hints for automatic addition of objects in guru dialog.
Default value: NULL
"interpolation" property "interpolation" gchar* : Read / Write
Default type of series line interpolation.
Default value: "linear"
"plot-group" property "plot-group" gchar* : Read / Write
Name of plot group if any.
Default value: NULL
"pseudo-3d-axis" property "pseudo-3d-axis" guint : Read / Write
Reference to pseudo-3D axis.
Allowed values: <= G_MAXINT
Default value: 0
"radial-axis" property "radial-axis" guint : Read / Write
Reference to radial axis.
Allowed values: <= G_MAXINT
Default value: 0
"vary-style-by-element" property "vary-style-by-element" gboolean : Read / Write
Use a different style for each segment.
Default value: FALSE
"x-axis" property "x-axis" guint : Read / Write
Reference to X axis.
Allowed values: <= G_MAXINT
Default value: 0
"y-axis" property "y-axis" guint : Read / Write
Reference to Y axis.
Allowed values: <= G_MAXINT
Default value: 0