GooAxis

GooAxis — an axis for a rectangle background.

Synopsis

enum                GooAxisType;
struct              GooAxis;
struct              GooAxisClass;
GooAxis *           goo_axis_new                        (GooCanvasItem *Parent,
                                                         GooCanvasItem *Back,
                                                         GooAxisType Modus,
                                                         gchar *Text,
                                                         ...);
void                goo_axis_get_grid_properties        (GooAxis *Axis,
                                                         ...);
void                goo_axis_get_subticks_properties    (GooAxis *Axis,
                                                         ...);
void                goo_axis_get_text_properties        (GooAxis *Axis,
                                                         ...);
void                goo_axis_get_ticks_properties       (GooAxis *Axis,
                                                         ...);
void                goo_axis_set_grid_properties        (GooAxis *Axis,
                                                         ...);
void                goo_axis_set_subticks_properties    (GooAxis *Axis,
                                                         ...);
void                goo_axis_set_text_properties        (GooAxis *Axis,
                                                         ...);
void                goo_axis_set_ticks_properties       (GooAxis *Axis,
                                                         ...);

Object Hierarchy

  GObject
   +----GooCanvasItemSimple
         +----GooCanvasGroup
               +----GooAxis

Implemented Interfaces

GooAxis implements GooCanvasItem.

Properties

  "format"                   gchar                 : Read / Write
  "logbasis"                 gdouble               : Read / Write
  "offset"                   gchar                 : Write
  "offset-across"            gdouble               : Read / Write
  "offset-along"             gdouble               : Read / Write
  "range"                    gchar                 : Read / Write
  "subticks"                 guint                 : Read / Write
  "text"                     gchar                 : Read / Write
  "text-align"               PangoAlignment        : Read / Write
  "text-offset"              gdouble               : Read / Write
  "tick-angle"               gdouble               : Read / Write
  "tick-length"              gchar                 : Read / Write
  "tick-offset"              gdouble               : Read / Write
  "ticks"                    gchar                 : Read / Write

Description

GooAxis is a subclass of GooCanvasGroup and so inherits all of the style properties such as "stroke-color", "fill-color" and "line-width". It also inherits the GooCanvasItem interface, so you can use the GooCanvasItem functions such as goo_canvas_item_raise() and goo_canvas_item_rotate().

Setting a style property on a GooAxis will affect all children of the GooAxis (unless the children override the property setting).

The GooAxis group contains these childs:

  • a GooCanvasPath for the base line,

  • a GooCanvasText with the axis label,

  • a GooCanvasGroup of texts with the tick labels and

  • three GooCanvasPath with tick lines, grid lines and subtick lines.

To create a GooAxis use goo_axis_new().

To set or get individual properties for the childs use the functions goo_axis_[get|set]_XYZ_properties with XYZ for grid, ticks, subticks and text (ticklabels). The remaining items (label and base line) are contolled directly by the GooAxis properties.

Position and length of the axis are connected to the background box. Also the transformation matrix of the background box is applied to the GooAxis. Note: it's not supported to move the background box after creating the GooAxis. Instead put the background box and the GooAxis in to a GooCanvasGroup and move the entire group.

Details

enum GooAxisType

typedef enum {
  GOO_AXIS_WEST,
  GOO_AXIS_SOUTH,
  GOO_AXIS_EAST,
  GOO_AXIS_NORTH,
  GOO_GRIDAXIS_WEST,
  GOO_GRIDAXIS_SOUTH,
  GOO_GRIDAXIS_EAST,
  GOO_GRIDAXIS_NORTH,
} GooAxisType;

Enum values used for goo_axis_new(), to specify the position and the type of the axis.

GOO_AXIS_WEST

the axis is on the left of the background box

GOO_AXIS_SOUTH

the axis is below the background box

GOO_AXIS_EAST

the axis is on the right of the background box

GOO_AXIS_NORTH

the axis is above the background box

GOO_GRIDAXIS_WEST

the axis is on the left of the background box and grid line are drawn in the background box

GOO_GRIDAXIS_SOUTH

the axis is below the background box and grid line are drawn in the background box

GOO_GRIDAXIS_EAST

the axis is on the right of the background box and grid line are drawn in the background box

GOO_GRIDAXIS_NORTH

the axis is above the background box and grid line are drawn in the background box

struct GooAxis

struct GooAxis;

The GooAxis struct contains private data only.


struct GooAxisClass

struct GooAxisClass;

The GooAxisClass struct contains private data only.


goo_axis_new ()

GooAxis *           goo_axis_new                        (GooCanvasItem *Parent,
                                                         GooCanvasItem *Back,
                                                         GooAxisType Modus,
                                                         gchar *Text,
                                                         ...);

Creates a new axis item.

Parent :

the parent item, or NULL. If a parent is specified, it will assume ownership of the item, and the item will automatically be freed when it is removed from the parent. Otherwise call g_object_unref() to free it.

Back :

the background box to connect the axis to (a GooCanvasRect, GooCanvasImage, GooCanvasGroup, ...). Note: to set the axis position and size, the properties "x", "y", "width" and "height" will be red (and therefore must be set in the background box item).

Modus :

the position and type as a GooAxisType value (like GOO_AXIS_SOUTH or GOO_GRIDAXIS_SOUTH, ...)

Text :

the label text for the axis. You can use Pango markup language to format the text.

... :

optional pairs of property names and values, and a terminating NULL.

Returns :

a new axis item. [transfer full]

Since 0.0


goo_axis_get_grid_properties ()

void                goo_axis_get_grid_properties        (GooAxis *Axis,
                                                         ...);

Get one or more properties of the GooCanvasPath of grid lines.

Axis :

a GooAxis

... :

optional pairs of property names and values, and a terminating NULL.

Since 0.0


goo_axis_get_subticks_properties ()

void                goo_axis_get_subticks_properties    (GooAxis *Axis,
                                                         ...);

Get one or more properties of the GooCanvasPath of subtick lines.

Axis :

a GooAxis

... :

optional pairs of property names and values, and a terminating NULL.

Since 0.0


goo_axis_get_text_properties ()

void                goo_axis_get_text_properties        (GooAxis *Axis,
                                                         ...);

Get one or more properties of the GooCanvasGroup of ticklabels.

Axis :

a GooAxis

... :

optional pairs of property names and values, and a terminating NULL.

Since 0.0


goo_axis_get_ticks_properties ()

void                goo_axis_get_ticks_properties       (GooAxis *Axis,
                                                         ...);

get one or more properties of the GooCanvasPath of tick lines (and connection lines if the second value of "offset" is set).

Axis :

a GooAxis

... :

optional pairs of property names and values, and a terminating NULL.

Since 0.0


goo_axis_set_grid_properties ()

void                goo_axis_set_grid_properties        (GooAxis *Axis,
                                                         ...);

Set one or more properties for the GooCanvasPath of grid lines.

Axis :

a GooAxis

... :

optional pairs of property names and values, and a terminating NULL.

Since 0.0


goo_axis_set_subticks_properties ()

void                goo_axis_set_subticks_properties    (GooAxis *Axis,
                                                         ...);

Set one or more properties for the GooCanvasPath of subtick lines (and connection lines if the second value of "offset" is set).

Axis :

a GooAxis

... :

optional pairs of property names and values, and a terminating NULL.

Since 0.0


goo_axis_set_text_properties ()

void                goo_axis_set_text_properties        (GooAxis *Axis,
                                                         ...);

Set one or more properties for the GooCanvasGroup of ticklabels.

Axis :

a GooAxis

... :

optional pairs of property names and values, and a terminating NULL.

Since 0.0


goo_axis_set_ticks_properties ()

void                goo_axis_set_ticks_properties       (GooAxis *Axis,
                                                         ...);

Set one or more properties for the GooCanvasPath of tick lines.

Axis :

a GooAxis

... :

optional pairs of property names and values, and a terminating NULL.

Since 0.0

Property Details

The "format" property

  "format"                   gchar                 : Read / Write

The format for the tick labels (defaults to "%g" if "format" is NULL or ""). This can be used to putput customized tick labels, ie including additional text. Note: tick labels don't use markup. To set text attributes use goo_axis_set_text_properties().

Default value: NULL

Since 0.0


The "logbasis" property

  "logbasis"                 gdouble               : Read / Write

The basis of an logarithmic scale for the axis (or 0.0 for linear scale). When a basis is set and the "ticks" property has no or one value, then the autoscale function will set ticks with an exponential increase for the given base. If more than one value is set in the "ticks" property the ticks will be set as defined there.

Allowed values: >= 0

Default value: 0

Since 0.0


The "offset" property

  "offset"                   gchar                 : Write

The offset between the background box and the axis base line (and all elements of the axis). By default the baseline is placed at the border of the background box. This may contain

  • no value for default (equals to "0 0"). Example "" or NULL.

  • one value for additional distance in outward direction. Example: "10"

  • two values for outward and sideward distance. Example: "10 -7.5"

The offset can be used to draw more than one axis at the same position.

In case of syntax 3 the axis gets a 3D style, A positive second value will move a horizontal axis to the right and a vertical axis downwards. Additional lines between the axis ticks and the corresponding position at the background box are drawn. These lines are in the ticks group, their style can be changed by goo_axis_set_ticks_properties().

Default value: NULL

Since 0.0


The "offset-across" property

  "offset-across"            gdouble               : Read / Write

The distance between the axis and the background item across the axis direction.

Default value: 0


The "offset-along" property

  "offset-along"             gdouble               : Read / Write

The distance between the axis and the background item along the axis direction.

Default value: 0


The "range" property

  "range"                    gchar                 : Read / Write

The borders of the axis (or NULL to reset). This may contain

  • no value (the axis is unscaled, the values in Dat will be spread equidistantly in the given order along the axis).

  • one value to scale the axis from zero to a positive value or from a negative value to zero.

  • two values for the left (down) and the right (up) border. The left value may be greater than the right value to scale in reverse order.

Default value: NULL

Since 0.0


The "subticks" property

  "subticks"                 guint                 : Read / Write

The number of subticks between the main ticks. Ie a value of 1 adds one subtick.

Allowed values: <= 9

Default value: 0

Since 0.0


The "text" property

  "text"                     gchar                 : Read / Write

The label text to use at the axis (or NULL to reset). PangoMarkupFormat is used to format the text. Example: "tan (<i>theta</i>)"

Default value: NULL

Since 0.0


The "text-align" property

  "text-align"               PangoAlignment        : Read / Write

The allignment for the label text as a PANGO_TYPE_ALIGNMENT value.

Default value: PANGO_ALIGN_CENTER

Since 0.0


The "text-offset" property

  "text-offset"              gdouble               : Read / Write

Additional space between the tick labels and the axis text. By default the text is placed next to the tick labels. A positiv "text-offset" adds some space in outward direction. A negativ value will move the text towards the background box.

Default value: 0

Since 0.0


The "tick-angle" property

  "tick-angle"               gdouble               : Read / Write

The rotation of the tick texts at the axis. By default the text is placed in horizontal direction for all axis positions. Using this property the text can be rotated, ie to get more space for the tick labels. A positive value rotates counterclockwise. For small and big "tick-angle" values the tick line is connected to the edge of the text. In case of medium-sized "tick-angle" values the tick line is connected to the corner of the text.

Allowed values: [-90,90]

Default value: 0

Since 0.0


The "tick-length" property

  "tick-length"              gchar                 : Read / Write

The length of the tick lines at the axis (or NULL for default). This may contain

  • no value for default (8 units in outward direction, 0 units in inward direction). Example: NULL or ""

  • one value for the tick length in outward direction. Example: "15" for tick lines with a length of 15 units in outward direction.

  • two values for the tick length in outward and inward direction. Example: "8 0" for the default value mentioned above.

Default value: NULL

Since 0.0


The "tick-offset" property

  "tick-offset"              gdouble               : Read / Write

Additional space between the ticks and the tick labels. By default the tick labels are placed next to the ticks. A positiv "tick-offset" adds some space in outward direction. A negativ value will move the tick labels towards the background box.

Default value: 0

Since 0.0


The "ticks" property

  "ticks"                    gchar                 : Read / Write

Where to set ticks at the axis (or NULL for autoscale). This may contain

  • no value for autoscale. The autoscale function calculates the values for the ticks based on the axis length and the maximum space needed by the left and the right border tick labels in the current font. Example: "" or NULL

  • one value for the distance of the ticks (ignored when "logbasis" != 0.0). Example: "0.5" will set ticks at 0, 0.5, 1, 1.5, ...

  • two or more values to specify the tick positions. The positions may be unequal spaced. Example: "-1 1 3 7.5"

  • pairs of a value and a corresponding text in braces. The text will be set at the position instead of the value. Example: "1{small} 3{middle} 6{large}"

Ticks will be labeled with the value unless syntax 4 is used. To set the label format use "format".

Default value: "0"

Since 0.0