GOffice.GraphGraph

g GObject.GInterface GObject.GInterface GOffice.Persist GOffice.Persist GObject.GInterface->GOffice.Persist GOffice.StyledObject GOffice.StyledObject GObject.GInterface->GOffice.StyledObject GObject.Object GObject.Object GOffice.GraphObject GOffice.GraphObject GObject.Object->GOffice.GraphObject GOffice.GraphGraph GOffice.GraphGraph GOffice.GraphStyledObject GOffice.GraphStyledObject GOffice.GraphObject->GOffice.GraphStyledObject GOffice.GraphOutlinedObject GOffice.GraphOutlinedObject GOffice.GraphOutlinedObject->GOffice.GraphGraph GOffice.GraphStyledObject->GOffice.GraphOutlinedObject GOffice.Persist->GOffice.GraphGraph GOffice.StyledObject->GOffice.GraphStyledObject

Subclasses:

None

Methods

Inherited:

GOffice.GraphOutlinedObject (1), GOffice.GraphObject (40), GObject.Object (37), GOffice.StyledObject (8), GOffice.Persist (2)

Structs:

GObject.ObjectClass (5)

class

get_supported_image_formats ()

dup ()

export_image (format, output, x_dpi, y_dpi)

force_update ()

get_data ()

get_document ()

get_size (width, height)

get_theme ()

num_cols ()

num_rows ()

ref_data (dat)

render_to_cairo (cairo, w, h)

request_update ()

set_size (width, height)

set_theme (theme)

unref_data (dat)

validate_chart_layout ()

Virtual Methods

Inherited:

GOffice.GraphStyledObject (2), GOffice.GraphObject (18), GObject.Object (7)

do_add_data (input)

do_remove_data (input)

Properties

Inherited:

GOffice.GraphOutlinedObject (1), GOffice.GraphObject (8)

Name

Type

Flags

Short Description

document

GOffice.Doc

r/w

the document for this graph

height-pts

float

r/w

Logical graph height, in points

theme

GOffice.GraphTheme

r/w

The theme for elements of the graph

theme-name

str

r/w

The name of the theme for elements of the graph

width-pts

float

r/w

Logical graph width, in points

Signals

Inherited:

GOffice.GraphStyledObject (1), GOffice.GraphObject (7), GObject.Object (1)

Name

Short Description

add-data

The ::add-data signal is emitted BEFORE data has been added.

remove-data

The ::remove-data signal is emitted BEFORE data has been removed.

Fields

Inherited:

GOffice.GraphStyledObject (1), GOffice.GraphObject (7), GObject.Object (1)

Name

Type

Access

Description

base

GOffice.GraphOutlinedObject

r

charts

[object]

r

data

[object]

r

data_refs

{object: object}

r

doc

GOffice.Doc

r

height

float

r

idle_handler

int

r

theme

GOffice.GraphTheme

r

width

float

r

Class Details

class GOffice.GraphGraph(**kwargs)
Bases:

GOffice.GraphOutlinedObject, GOffice.Persist

Abstract:

No

Structure:

GOffice.GraphGraphClass

classmethod get_supported_image_formats()
Returns:

a GLib.SList of GOffice.ImageFormat.

Return type:

[GOffice.ImageFormat]

Builds a list of supported formats for image export.

dup()
Returns:

a deep copy of self.

Return type:

GOffice.GraphGraph

export_image(format, output, x_dpi, y_dpi)
Parameters:
Returns:

True if export succeed.

Return type:

bool

Exports an image of self in given format, writing results in a Gsf.Output stream. If export format type is a bitmap one, it computes image size with x_dpi, y_dpi and self size (see gog_graph_get_size()).

force_update()

Do an update now if one has been queued.

get_data()
Returns:

a list of the GOffice.Data objects that are data to the graph. The caller should _not_ modify or free the list.

Return type:

[GOffice.Data]

get_document()
Returns:

the document.

Return type:

GOffice.Doc

Retrieves the GOffice.Doc for self.

get_size(width, height)
Parameters:
  • width (float) – logical width in pts

  • height (float) – logical height in pts

FIXME Returns the logical size of graph, in points.

get_theme()
Returns:

the GOffice.GraphTheme used by self.

Return type:

GOffice.GraphTheme

num_cols()
Return type:

int

num_rows()
Return type:

int

ref_data(dat)
Parameters:

dat (GOffice.Data) – GOffice.Data

Returns:

dat or something equivalent to it that already exists in the graph. Otherwise use dat. Adds a gobject ref to the target and increments a GOffice.count of the number of refs made from this GOffice.GraphGraph.

Return type:

GOffice.Data

render_to_cairo(cairo, w, h)
Parameters:

Renders a graph using cairo. w and h are the requested width an height of the rendered graph, in the current cairo coordinate space. This function is not suited for multiple rendering of the same graph. gog_renderer_render_to cairo or GOffice.GraphRenderer.update/GOffice.GraphRenderer.get_cairo_surface should be used instead.

request_update()
Returns:

True if a handler has been added.

Return type:

bool

queue an update if one had not already be queued.

set_size(width, height)
Parameters:
  • width (float) – logical width in pts

  • height (float) – logical height in pts

Sets the logical size of graph, given in points.

set_theme(theme)
Parameters:

theme (GOffice.GraphTheme) –

unref_data(dat)
Parameters:

dat (GOffice.Data) – GOffice.Data

validate_chart_layout()
Returns:

True if anything changed.

Return type:

bool

Check the layout of the chart grid and ensure that there are no empty cols or rows, and resize as necessary

do_add_data(input) virtual
Parameters:

input (GOffice.Data) –

do_remove_data(input) virtual
Parameters:

input (GOffice.Data) –

Signal Details

GOffice.GraphGraph.signals.add_data(graph_graph, data)
Signal Name:

add-data

Flags:

RUN_LAST

Parameters:

The ::add-data signal is emitted BEFORE data has been added.

GOffice.GraphGraph.signals.remove_data(graph_graph, data)
Signal Name:

remove-data

Flags:

RUN_LAST

Parameters:

The ::remove-data signal is emitted BEFORE data has been removed.

Property Details

GOffice.GraphGraph.props.document
Name:

document

Type:

GOffice.Doc

Default Value:

None

Flags:

READABLE, WRITABLE

the document for this graph

GOffice.GraphGraph.props.height_pts
Name:

height-pts

Type:

float

Default Value:

226.77165354330708

Flags:

READABLE, WRITABLE

Logical graph height, in points

GOffice.GraphGraph.props.theme
Name:

theme

Type:

GOffice.GraphTheme

Default Value:

None

Flags:

READABLE, WRITABLE

The theme for elements of the graph

GOffice.GraphGraph.props.theme_name
Name:

theme-name

Type:

str

Default Value:

'default'

Flags:

READABLE, WRITABLE

The name of the theme for elements of the graph

GOffice.GraphGraph.props.width_pts
Name:

width-pts

Type:

float

Default Value:

340.15748031496065

Flags:

READABLE, WRITABLE

Logical graph width, in points