## GogAxis

GogAxis — Master axes

## Synopsis

                GogAxis;
                GogAxisTick;
    enum        GogAxisElemType;
    GogAxisType gog_axis_get_atype              (GogAxis const *axis);
    gboolean    gog_axis_is_center_on_ticks     (GogAxis const *axis);
    gboolean    gog_axis_is_discrete            (GogAxis const *axis);
    gboolean    gog_axis_is_inverted            (GogAxis const *axis);
    gboolean    gog_axis_get_bounds             (GogAxis const *axis,
                                                 double *minima,
                                                 double *maxima);
    void        gog_axis_set_bounds             (GogAxis *axis,
                                                 double minimum,
                                                 double maximum);
    void        gog_axis_set_extents            (GogAxis *axis,
                                                 double start,
                                                 double stop);
    unsigned    gog_axis_get_ticks              (GogAxis *axis,
                                                 GogAxisTick **ticks);
    GOData*     gog_axis_get_labels             (GogAxis const *axis,
                                                 GogPlot **plot_that_labeled_axis);
    double      gog_axis_get_entry              (GogAxis const *axis,
                                                 GogAxisElemType i,
                                                 gboolean *user_defined);
    void        gog_axis_add_contributor        (GogAxis *axis,
                                                 GogObject *contrib);
    void        gog_axis_del_contributor        (GogAxis *axis,
                                                 GogObject *contrib);
    GSListconst * gog_axis_contributors         (GogAxis *axis);
    void        gog_axis_clear_contributors     (GogAxis *axis);
    void        gog_axis_bound_changed          (GogAxis *axis,
                                                 GogObject *contrib);
    GogGridLine* gog_axis_get_grid_line         (GogAxis *axis,
                                                 gboolean major);

## Object Hierarchy

      GObject
       +----GogObject
             +----GogStyledObject
                   +----GogAxisBase
                         +----GogAxis

## Implemented Interfaces

GogAxis implements GogDataset.

## Properties

      "assigned-format-string-XL" gchararray            : Read / Write
      "invert-axis"          gboolean              : Read / Write
      "map-name"             gchararray            : Read / Write
      "type"                 gint                  : Read / Write

## Description

## Details

### GogAxis

    typedef struct _GogAxis GogAxis;

### GogAxisTick

    typedef struct {
    	double		 position;
    	GogAxisTickTypes	 type;
    	char 		*label;
    } GogAxisTick;

### enum GogAxisElemType

    typedef enum {
    	GOG_AXIS_ELEM_MIN = 0,
    	GOG_AXIS_ELEM_MAX,
    	GOG_AXIS_ELEM_MAJOR_TICK,
    	GOG_AXIS_ELEM_MINOR_TICK,
    	GOG_AXIS_ELEM_CROSS_POINT,
    	GOG_AXIS_ELEM_MAX_ENTRY
    } GogAxisElemType;

### gog_axis_get_atype ()

    GogAxisType gog_axis_get_atype              (GogAxis const *axis);

`axis` : |
Returns : |

### gog_axis_is_center_on_ticks ()

    gboolean    gog_axis_is_center_on_ticks     (GogAxis const *axis);

`axis` : | GogAxis
Returns : | TRUE if labels are centered on ticks when `axis` is discrete

### gog_axis_is_discrete ()

    gboolean    gog_axis_is_discrete            (GogAxis const *axis);

`axis` : | GogAxis
Returns : | TRUE if `axis` enumerates a set of discrete items, rather than a continuous value

### gog_axis_is_inverted ()

    gboolean    gog_axis_is_inverted            (GogAxis const *axis);

`axis` : | GogAxis
Returns : | TRUE if `axis` is inverted.

### gog_axis_get_bounds ()

    gboolean    gog_axis_get_bounds             (GogAxis const *axis,
                                                 double *minima,
                                                 double *maxima);

return TRUE if the bounds stored in `minima` and `maxima` are sane

`axis` : | GogAxis
`minima` : | result
`maxima` : | result
Returns : |

### gog_axis_set_bounds ()

    void        gog_axis_set_bounds             (GogAxis *axis,
                                                 double minimum,
                                                 double maximum);

Sets axis bounds. If minimum or maximum are not finite values, corresponding bound remains unchanged.

`axis` : | GogAxis
`minimum` : | axis low bound
`maximum` : | axis high bound

### gog_axis_set_extents ()

    void        gog_axis_set_extents            (GogAxis *axis,
                                                 double start,
                                                 double stop);

Set axis exents. It's a convenience function that sets axis bounds taking into account invert flag.

`axis` : | GogAxis
`start` : | axis start bound
`stop` : | axis stop bound

### gog_axis_get_ticks ()

    unsigned    gog_axis_get_ticks              (GogAxis *axis,
                                                 GogAxisTick **ticks);

An accessor to `axis->ticks`.

`axis` : | GogAxis
`ticks` : | an array of GogAxisTick
Returns : | number of ticks

### gog_axis_get_labels ()

    GOData*     gog_axis_get_labels             (GogAxis const *axis,
                                                 GogPlot **plot_that_labeled_axis);

`axis` : | a GogAxis
`plot_that_labeled_axis` : | a GogPlot
Returns : | the possibly NULL GOData used as a label for this axis along with the plot that it was associated with

### gog_axis_get_entry ()

    double      gog_axis_get_entry              (GogAxis const *axis,
                                                 GogAxisElemType i,
                                                 gboolean *user_defined);

`axis` : | GogAxis
`i` : |
`user_defined` : | an optionally NULL pointr to gboolean
Returns : | the value of axis element `i` and sets `user_defined` or NaN on error

### gog_axis_add_contributor ()

    void        gog_axis_add_contributor        (GogAxis *axis,
                                                 GogObject *contrib);

Register `contrib` as taking part in the negotiation of `axis`'s bounds.

`axis` : | GogAxis
`contrib` : | GogObject (can we relax this to use an interface ?)

### gog_axis_del_contributor ()

    void        gog_axis_del_contributor        (GogAxis *axis,
                                                 GogObject *contrib);

`contrib` no longer takes part in the negotiation of `axis`'s bounds.

`axis` : | GogAxis
`contrib` : | GogObject (can we relax this to use an interface ?)

### gog_axis_contributors ()

    GSListconst * gog_axis_contributors         (GogAxis *axis);

`axis` : |
Returns : |

### gog_axis_clear_contributors ()

    void        gog_axis_clear_contributors     (GogAxis *axis);

`axis` : |

### gog_axis_bound_changed ()

    void        gog_axis_bound_changed          (GogAxis *axis,
                                                 GogObject *contrib);

`axis` : | GogAxis
`contrib` : | GogObject

### gog_axis_get_grid_line ()

    GogGridLine* gog_axis_get_grid_line         (GogAxis *axis,
                                                 gboolean major);

`axis` : |
`major` : |
Returns : |

## Property Details

### The "`assigned-format-string-XL`" property

      "assigned-format-string-XL" gchararray            : Read / Write

The user assigned format to use for non-discrete axis labels (XL format).

Default value: "General"

### The "`invert-axis`" property

      "invert-axis"          gboolean              : Read / Write

Scale from high to low rather than low to high.

Default value: FALSE

### The "`map-name`" property

      "map-name"             gchararray            : Read / Write

The name of the map for scaling.

Default value: "linear"

### The "`type`" property

      "type"                 gint                  : Read / Write

GogAxisType.

Allowed values: [-1,6]

Default value: -1