PocLegend

PocLegend — Widget to display a legend for a PocPlot.

Functions

Properties

gdouble legend-text-size Read / Write
gdouble line-sample-size Read / Write
gdouble line-spacing Read / Write
PocPlot * plot Read / Write
gdouble title-text-size Read / Write

Types and Values

Object Hierarchy

    GObject
    ╰── GInitiallyUnowned
        ╰── GtkWidget
            ╰── GtkDrawingArea
                ╰── PocLegend

Implemented Interfaces

PocLegend implements AtkImplementorIface and GtkBuildable.

Includes

#include <poc.h>

Description

PocLegend displays a legend for the specified PocPlot widget. Plot and dataset titles are used for legend text and dataset line styles and colours are used for the line samples.

Please note that although operational, PocLegend is more of a proof-of-concept at present and needs some work on its aesthetics.

Functions

poc_legend_new ()

PocLegend *
poc_legend_new (void);

Create a new PocLegend

Returns

New PocLegend.

[transfer full]


poc_legend_set_plot ()

void
poc_legend_set_plot (PocLegend *self,
                     PocPlot *plot);

Display a legend for the associated plot widget.

Parameters

self

A PocLegend

 

plot

A PocPlot

 

poc_legend_get_plot ()

PocPlot *
poc_legend_get_plot (PocLegend *self);

Return the associated plot.

Parameters

self

A PocLegend

 

Returns

a PocPlot.

[transfer none]


poc_legend_set_title_text_size ()

void
poc_legend_set_title_text_size (PocLegend *self,
                                gdouble title_text_size);

Set title text size.

Parameters

self

A PocLegend

 

title_text_size

text size

 

poc_legend_get_title_text_size ()

gdouble
poc_legend_get_title_text_size (PocLegend *self);

Get title text size.

Parameters

self

A PocLegend

 

Returns

size


poc_legend_set_legend_text_size ()

void
poc_legend_set_legend_text_size (PocLegend *self,
                                 gdouble legend_text_size);

Set legend text size.

Parameters

self

A PocLegend

 

legend_text_size

text size

 

poc_legend_get_legend_text_size ()

gdouble
poc_legend_get_legend_text_size (PocLegend *self);

Get legend text size.

Parameters

self

A PocLegend

 

Returns

size


poc_legend_set_line_sample_size ()

void
poc_legend_set_line_sample_size (PocLegend *self,
                                 gdouble line_sample_size);

Set line sample size.

Parameters

self

A PocLegend

 

line_sample_size

text size

 

poc_legend_get_line_sample_size ()

gdouble
poc_legend_get_line_sample_size (PocLegend *self);

Get line sample size.

Parameters

self

A PocLegend

 

Returns

size


poc_legend_set_line_spacing ()

void
poc_legend_set_line_spacing (PocLegend *self,
                             gdouble line_spacing);

Set line spacing as a multiple of the text height where 1.0 equals text height.

Parameters

self

A PocLegend

 

line_spacing

text size

 

poc_legend_get_line_spacing ()

gdouble
poc_legend_get_line_spacing (PocLegend *self);

Get line spacing.

Parameters

self

A PocLegend

 

Returns

size

Types and Values

POC_TYPE_LEGEND

#define POC_TYPE_LEGEND   poc_legend_get_type ()

PocLegend

typedef struct _PocLegend PocLegend;

Property Details

The “legend-text-size” property

  “legend-text-size”         gdouble

Size for legend text.

Owner: PocLegend

Flags: Read / Write

Allowed values: >= 1

Default value: 10


The “line-sample-size” property

  “line-sample-size”         gdouble

Length of sample line.

Owner: PocLegend

Flags: Read / Write

Allowed values: >= 1

Default value: 50


The “line-spacing” property

  “line-spacing”             gdouble

Factor to scale line spacing.

Owner: PocLegend

Flags: Read / Write

Allowed values: [0.8,5]

Default value: 1


The “plot” property

  “plot”                     PocPlot *

Generate legend for the specified plot.

Owner: PocLegend

Flags: Read / Write


The “title-text-size” property

  “title-text-size”          gdouble

Size for title text.

Owner: PocLegend

Flags: Read / Write

Allowed values: >= 1

Default value: 12

See Also

PocPlot