PocDataset

PocDataset — Dataset for PocPlot

Functions

Properties

gchar * legend Read / Write
GdkRGBA * line-stroke Read / Write
PocLineStyle line-style Read / Write
gchar * nickname Read / Write
PocPointArray * points Read / Write
PocAxis * x-axis Read / Write
PocAxis * y-axis Read / Write

Signals

Types and Values

Object Hierarchy

    GObject
    ╰── PocDataset
        ╰── PocDatasetSpline

Includes

#include <poc.h>

Description

A PocDataset represents data to be plotted on a PocPlot canvas. Any number of datasets may be added to a plot. Each dataset has X and Y axes which controls the range of data plotted and allow optionally allow the plot to be scrolled.

Although the dataset contains drawing code, drawing always takes place under control of the PocPlot and on its canvas.

The PocDataset base class draws a plot using straight line segments between each of the control points, however it may be subclassed for alternative plotting algorithms.

Functions

poc_dataset_new ()

PocDataset *
poc_dataset_new (void);

Create a new PocDataset

Returns

New PocDataset.

[transfer full]


poc_dataset_set_nickname ()

void
poc_dataset_set_nickname (PocDataset *self,
                          const gchar *nickname);

Set the name for the dataset.

Parameters

self

A PocDataset

 

nickname

dataset name

 

poc_dataset_get_nickname ()

const gchar *
poc_dataset_get_nickname (PocDataset *self);

Get the name for the dataset.

Parameters

self

A PocDataset

 

Returns

the nickname.

[transfer none]


poc_dataset_set_legend ()

void
poc_dataset_set_legend (PocDataset *self,
                        const gchar *legend);

Set the legend for the dataset item.

Parameters

self

A PocDataset

 

legend

legend text

 

poc_dataset_get_legend ()

const gchar *
poc_dataset_get_legend (PocDataset *self);

Get the legend for the dataset item.

Parameters

self

A PocDataset

 

Returns

legend text.

[transfer none]


poc_dataset_get_line_stroke ()

void
poc_dataset_get_line_stroke (PocDataset *self,
                             GdkRGBA *rgba);

Get the colour for stroking plot lines.

Parameters

self

A PocDataset

 

rgba

A GdkRGBA to receive the line stroke colour

 

poc_dataset_set_line_stroke ()

void
poc_dataset_set_line_stroke (PocDataset *self,
                             const GdkRGBA *rgba);

Set the colour for stroking plot lines.

Parameters

self

A PocDataset

 

rgba

A GdkRGBA

 

poc_dataset_set_line_style ()

void
poc_dataset_set_line_style (PocDataset *self,
                            PocLineStyle line_style);

Set the line style for stroking dataset plot lines.

Parameters

self

A PocDataset

 

line_style

Requested line style

 

poc_dataset_get_line_style ()

PocLineStyle
poc_dataset_get_line_style (PocDataset *self);

Get the dataset's line style

Parameters

self

A PocDataset

 

Returns

a PocLineStyle


poc_dataset_set_x_axis ()

void
poc_dataset_set_x_axis (PocDataset *self,
                        PocAxis *axis);

Set the X axis associated with this dataset.

Parameters

self

A PocDataset

 

axis

a PocAxis

 

poc_dataset_get_x_axis ()

PocAxis *
poc_dataset_get_x_axis (PocDataset *self);

Get the X axis associated with this dataset.

Parameters

self

A PocDataset

 

Returns

a PocAxis.

[transfer none]


poc_dataset_set_y_axis ()

void
poc_dataset_set_y_axis (PocDataset *self,
                        PocAxis *axis);

Set the Y axis associated with this dataset.

Parameters

self

A PocDataset

 

axis

a PocAxis

 

poc_dataset_get_y_axis ()

PocAxis *
poc_dataset_get_y_axis (PocDataset *self);

Get the X axis associated with this dataset.

Parameters

self

A PocDataset

 

Returns

a PocAxis.

[transfer none]


poc_dataset_set_points ()

void
poc_dataset_set_points (PocDataset *self,
                        PocPointArray *points);

Set the array of control points for the dataset.

Parameters

self

A PocDataset

 

points

A PocPointArray with the control points

 

poc_dataset_get_points ()

PocPointArray *
poc_dataset_get_points (PocDataset *self);

Get the array of control points for the dataset.

Parameters

self

A PocDataset

 

Returns

A PocPointArray.

[transfer none]


poc_dataset_notify_update ()

void
poc_dataset_notify_update (PocDataset *self);

poc_dataset_invalidate ()

void
poc_dataset_invalidate (PocDataset *self);

Notify subclasses cached data is invalid.

Parameters

self

A PocDataset

 

poc_dataset_draw ()

void
poc_dataset_draw (PocDataset *self,
                  cairo_t *cr,
                  guint width,
                  guint height);

Draw the dataset in the main plot area. Used by PocPlot.

Parameters

self

A PocDataset

 

cr

A cairo_t

 

width

Plot area width

 

height

Plot area height

 

poc_dataset_set_points_array ()

void
poc_dataset_set_points_array (PocDataset *self,
                              const gdouble *x,
                              const gdouble *y,
                              guint points);

Set the array of control points for the dataset. X and Y coordinates for each control point are specified in two arrays.

Parameters

self

A PocDataset

 

x

Array of x coordinates.

[array length=points]

y

Array of y coordinates.

[array length=points]

points

number of points in coordinate arrays

 

Types and Values

POC_TYPE_DATASET

#define POC_TYPE_DATASET		poc_dataset_get_type ()

struct PocDatasetClass

struct PocDatasetClass {
  void		(*draw)		(PocDataset *self, cairo_t *cr,
			         guint width, guint height);
  void		(*invalidate) (PocDataset *self);
};

The class structure for PocDatasetClass.

Members

draw ()

Method called by PocPlot to draw visible area of plot.

 

invalidate ()

Notify subclasses to invalidate cached data.

 

PocDataset

typedef struct _PocDataset PocDataset;

Property Details

The “legend” property

  “legend”                   gchar *

Legend for the item.

Owner: PocDataset

Flags: Read / Write

Default value: NULL


The “line-stroke” property

  “line-stroke”              GdkRGBA *

Colour for stroking lines.

Owner: PocDataset

Flags: Read / Write


The “line-style” property

  “line-style”               PocLineStyle

Line style for plot line.

Owner: PocDataset

Flags: Read / Write

Default value: POC_LINE_STYLE_SOLID


The “nickname” property

  “nickname”                 gchar *

Nickname for the dataset ("nickname" since Glade doesn't like "name").

Owner: PocDataset

Flags: Read / Write

Default value: NULL


The “points” property

  “points”                   PocPointArray *

Array of (X,Y) coordinates.

Owner: PocDataset

Flags: Read / Write


The “x-axis” property

  “x-axis”                   PocAxis *

X axis for dataset.

Owner: PocDataset

Flags: Read / Write


The “y-axis” property

  “y-axis”                   PocAxis *

Y axis for dataset.

Owner: PocDataset

Flags: Read / Write

Signal Details

The “update” signal

void
user_function (PocDataset *pocdataset,
               gpointer    user_data)

Flags: No Hooks

See Also

PocPlot PocAxis PocDatasetSpline