Top |
PocPlotPocPlot — PocPlot canvas widget |
PocPlot * | poc_plot_new () |
void | poc_plot_set_enable_plot_fill () |
gboolean | poc_plot_get_enable_plot_fill () |
void | poc_plot_get_plot_fill () |
void | poc_plot_set_plot_fill () |
gfloat | poc_plot_get_border () |
void | poc_plot_set_border () |
void | poc_plot_set_title () |
const gchar * | poc_plot_get_title () |
void | poc_plot_set_x_axis () |
PocAxis * | poc_plot_get_x_axis () |
void | poc_plot_set_y_axis () |
PocAxis * | poc_plot_get_y_axis () |
void | poc_plot_set_axis () |
void | poc_plot_add_dataset () |
void | poc_plot_remove_dataset () |
void | poc_plot_clear_dataset () |
PocDataset * | poc_plot_find_dataset () |
void | poc_plot_solo_dataset () |
PocAxis * | poc_plot_axis_at_point () |
void | poc_plot_add_axis () |
void | poc_plot_remove_axis () |
void | poc_plot_clear_axes () |
void | poc_plot_notify_update () |
gboolean | (*PocPlotDatasetForEachFunc) () |
PocDataset * | poc_plot_dataset_foreach () |
gboolean | (*PocPlotAxisForEachFunc) () |
PocAxis * | poc_plot_axis_foreach () |
PocPlot is a 2D graph plotting canvas. To create a plot, add PocAxis and
PocDataset gadgets to this widget, see poc_plot_add_dataset()
and
poc_plot_add_axis()
.
The PocPlot implementation supports a custom <plot>
element which supports
any number of <dataset>
and <axis>
elements.
An example of a UI definition fragment for a PocPlot.
1 2 3 4 5 6 7 8 9 10 11 12 |
<object class="PocPlot"> <plot> <dataset source="blue"/> <axis source="red" orientation="vertical" hidden="false"/> </plot> </object> <object class="PocDataset" id="blue"> ... </object> <object class="PocAxis" id="red"> ... </object> |
The <dataset>
element supports the following attributes:
source: Xml id of a PocDataset element.
x-pack: an optional GtkPackType, how to pack the dataset's X axis.
y-pack: an optional GtkPackType, how to pack the dataset's Y axis.
The <axis>
elements support the following attribute:
source: Xml id of a PocAxis element.
pack: an optional GtkPackType, how to pack the axis.
orientation: a GtkOrientation, set the Axis orientation
hidden: an optional gboolean, whether the axis should be displayed or hidden.
void poc_plot_set_enable_plot_fill (PocPlot *self
,gboolean value
);
Set whether to fill the plot area plot.
gboolean
poc_plot_get_enable_plot_fill (PocPlot *self
);
Get whether to fill the plot area plot.
void poc_plot_get_plot_fill (PocPlot *self
,GdkRGBA *rgba
);
Set the plot area background colour.
void poc_plot_set_plot_fill (PocPlot *self
,const GdkRGBA *rgba
);
Get the plot area plot colour.
void poc_plot_set_border (PocPlot *self
,gfloat size
);
Set the internal border width.
void poc_plot_set_title (PocPlot *self
,const gchar *title
);
Set the plot title. The title is not used directly by the PocPlot widget, however it may be used by other gadgets added to the plot.
void poc_plot_set_x_axis (PocPlot *self
,PocAxis *x_axis
);
Set the current X axis. This is used to draw the X axis grid lines in the plot area.
void poc_plot_set_y_axis (PocPlot *self
,PocAxis *y_axis
);
Set the current Y axis. This is used to draw the Y axis grid lines in the plot area.
void poc_plot_set_axis (PocPlot *self
,PocAxis *axis
);
Set the current axis. The PocPlot determines whether axis
refers to an
X or Y axis.
void poc_plot_add_dataset (PocPlot *self
,PocDataset *dataset
,GtkPackType x_pack
,GtkPackType y_pack
);
Add a PocDataset gadget to the plot. x_pack
and y_pack
determine which
edge of the plot should show the axes.
self |
A PocPlot |
|
dataset |
PocDataset to add. |
|
x_pack |
How to pack the X axis. |
|
y_pack |
How to pack the Y axis (start = bottom, end = top). |
void poc_plot_remove_dataset (PocPlot *self
,PocDataset *dataset
);
Remove a dataset
from the plot. The dataset
must already belong to the
plot. Axes that are no longer referenced by another PocDataset are also
removed.
void
poc_plot_clear_dataset (PocPlot *self
);
Remove all datasets from the plot.
PocDataset * poc_plot_find_dataset (PocPlot *self
,const gchar *nickname
);
Find a dataset belonging to the plot with the requested nickname.
void poc_plot_solo_dataset (PocPlot *self
,PocDataset *dataset
,gboolean solo
);
Show only the grid lines and plot data for the specified dataset
. If
multiple datasets have solo enabled only they are displayed, if no datasets
are solo then all datasets are displayed.
self |
A PocPlot. |
|
dataset |
A PocDataset belonging to the plot. |
|
solo |
|
PocAxis * poc_plot_axis_at_point (PocPlot *self
,gdouble x
,gdouble y
);
Find the PocAxis under the specifiec x
, y
coordinate.
void poc_plot_add_axis (PocPlot *self
,PocAxis *axis
,gboolean hidden
,GtkPackType pack
,GtkOrientation orientation
);
Add an axis to the plot. pack
and orientation
specify how the axis should
be displayed. Normally this is not required as axes belonging to datasets
are added automatically.
void poc_plot_remove_axis (PocPlot *self
,PocAxis *axis
);
Remove the axis
from the plot.
void
poc_plot_notify_update (PocPlot *self
);
Notify PocPlot of updates in a dataset or axis.
gboolean (*PocPlotDatasetForEachFunc) (PocPlot *self
,PocDataset *dataset
,gpointer user_data
);
PocDataset * poc_plot_dataset_foreach (PocPlot *self
,PocPlotDatasetForEachFunc predicate
,gpointer user_data
);
Call predicate
for each dataset in the plot. If predicate
returns
TRUE
return the dataset. If iteration completes NULL
is returned.
self |
A PocPlot |
|
predicate |
iterator predicate function. |
[scope call] |
user_data |
user data passed to |
gboolean (*PocPlotAxisForEachFunc) (PocPlot *self
,PocAxis *axis
,gpointer user_data
);
PocAxis * poc_plot_axis_foreach (PocPlot *self
,PocPlotAxisForEachFunc predicate
,gpointer user_data
);
Call predicate
for each axis in the plot. If predicate
returns
TRUE
return the axis. If iteration completes NULL
is returned.
self |
A PocPlot |
|
predicate |
iterator predicate function. |
[scope call] |
user_data |
user data passed to |
“border”
property“border” gfloat
Internal border width between plot items.
Owner: PocPlot
Flags: Read / Write / Construct
Allowed values: [0,100]
Default value: 6
“enable-plot-fill”
property“enable-plot-fill” gboolean
Enable plot fill colour.
Owner: PocPlot
Flags: Read / Write / Construct
Default value: FALSE
“plot-fill”
property“plot-fill” GdkRGBA *
Plot fill colour for graph area.
Owner: PocPlot
Flags: Read / Write
“title”
property“title” gchar *
Plot title.
Owner: PocPlot
Flags: Read / Write / Construct
Default value: NULL
“x-axis”
property“x-axis” PocAxis *
Current X axis - draw X coordinate grid for this axis.
Owner: PocPlot
Flags: Read / Write
“y-axis”
property“y-axis” PocAxis *
Current X axis - draw Y coordinate grid for this axis.
Owner: PocPlot
Flags: Read / Write