GOffice Reference Manual: GogChartMap

## GogChartMap GogChartMap |

## Functions

double | gog_chart_map_2D_derivative_to_view ()
void | gog_chart_map_2D_to_view ()
void | gog_chart_map_free ()
GogAxisMap * | gog_chart_map_get_axis_map ()
GogChartMapPolarData * | gog_chart_map_get_polar_parms ()
gboolean | gog_chart_map_is_valid ()
GOPath * | gog_chart_map_make_close_path ()
GOPath * | gog_chart_map_make_path ()
GogChartMap * | gog_chart_map_new ()
void | gog_chart_map_view_to_2D ()

## Types and Values

| GogChartMap
| GogChartMapPolarData

## Object Hierarchy

        GBoxed
        ╰── GogChartMap

## Description

## Functions

### gog_chart_map_2D_derivative_to_view ()

    double
    gog_chart_map_2D_derivative_to_view (GogChartMap *map,
                                         double deriv,
                                         double x,
                                         double y);

Converts a 2D slope from data space to canvas space. It is only implemented for xy maps.

#### Parameters

map | a GogChartMap |
deriv | the slope in data space |
x | data x value |
y | data y value |

#### Returns

the slope in canvas space or go_nan.

### gog_chart_map_2D_to_view ()

    void
    gog_chart_map_2D_to_view (GogChartMap *map,
                              double x,
                              double y,
                              double *u,
                              double *v);

Converts a 2D coordinate from data space to canvas space.

#### Parameters

map | a GogChartMap |
x | data x value |
y | data y value |
u | placeholder for x converted value |
v | placeholder for y converted value |

### gog_chart_map_free ()

    void
    gog_chart_map_free (GogChartMap *map);

Frees `map` object.

#### Parameters

map | a GogChartMap |

### gog_chart_map_get_axis_map ()

    GogAxisMap *
    gog_chart_map_get_axis_map (GogChartMap *map,
                                unsigned int index);

Convenience function which returns one of the associated axis_map.

Valid values are in range [0..2].

#### Parameters

map | a GogChartMap |
index | axis index |

#### Returns

a GogAxisMap.

[transfer none]

### gog_chart_map_get_polar_parms ()

    GogChartMapPolarData *
    gog_chart_map_get_polar_parms (GogChartMap *map);

Convenience function for retrieving data related to polar plot layout.

#### Parameters

map | a GogChartMap |

#### Returns

a GogChartMapPolarData struct.

[transfer none]

### gog_chart_map_is_valid ()

    gboolean
    gog_chart_map_is_valid (GogChartMap *map);

Tests if `map` was correctly initializied, i.e. if all associated axis_map are valid (see `gog_axis_map_is_valid()` ).

given to gog_chart_map_new.

#### Parameters

map | a GogChartMap |

#### Returns

`TRUE` if `map` is valid.

### gog_chart_map_make_close_path ()

    GOPath *
    gog_chart_map_make_close_path (GogChartMap *map,
                                   double const *x,
                                   double const *y,
                                   int n_points,
                                   GogSeriesFillType fill_type);

#### Parameters

map | a GogChartMap |
x | x data |
y | y data |
n_points | number of points |
fill_type | fill type |

#### Returns

a new GOPath using `x` and `y` data, with respect to `fill_type` .

### gog_chart_map_make_path ()

    GOPath *
    gog_chart_map_make_path (GogChartMap *map,
                             double const *x,
                             double const *y,
                             int n_points,
                             GOLineInterpolation interpolation,
                             gboolean skip_invalid,
                             gpointer data);

#### Parameters

map | a GogChartMap |
x | x data |
y | y data |
n_points | number of points |
interpolation | interpolation type |
skip_invalid | whether to ignore invalid data or interrupt the interpolation |

#### Returns

a new GOPath using `x` and `y` data, each valid point being connected with respect to `interpolation` .

### gog_chart_map_new ()

    GogChartMap *
    gog_chart_map_new (GogChart *chart,
                       GogViewAllocation const *area,
                       GogAxis *axis0,
                       GogAxis *axis1,
                       GogAxis *axis2,
                       gboolean fill_area);

Creates a new GogChartMap, used for conversion from data space to canvas space.

#### Parameters

chart | a GogChart |
area | area allocated to chart |
axis0 | 1st dimension axis |
axis1 | 2nd dimension axis |
axis2 | 3rd dimension axis |
fill_area | does chart fill allocated area |

#### Returns

a new GogChartMap object.

[transfer full]

### gog_chart_map_view_to_2D ()

    void
    gog_chart_map_view_to_2D (GogChartMap *map,
                              double x,
                              double y,
                              double *u,
                              double *v);

Converts a 2D coordinate from canvas space to data space.

#### Parameters

map | a GogChartMap |
x | data x value |
y | data y value |
u | placeholder for x converted value |
v | placeholder for y converted value |

## Types and Values

### GogChartMap

    typedef struct _GogChartMap GogChartMap;

### GogChartMapPolarData

    typedef struct {
    	double cx, cy;
    	double rx, ry;
    	double th0, th1;
    } GogChartMapPolarData;

#### Members

double `cx`; | center horizontal position. |
double `cy`; | center vertical position. |
double `rx`; | available horizontal space from the center. |
double `ry`; | available vertical space from the center. |
double `th0`; | start angle. |
double `th1`; | end angle. |