GOffice.GraphWidget

g Atk.ImplementorIface Atk.ImplementorIface Gtk.Widget Gtk.Widget Atk.ImplementorIface->Gtk.Widget GObject.GInterface GObject.GInterface GObject.GInterface->Atk.ImplementorIface Gtk.Buildable Gtk.Buildable GObject.GInterface->Gtk.Buildable Gtk.Scrollable Gtk.Scrollable GObject.GInterface->Gtk.Scrollable GObject.InitiallyUnowned GObject.InitiallyUnowned GObject.InitiallyUnowned->Gtk.Widget GObject.Object GObject.Object GObject.Object->GObject.InitiallyUnowned GOffice.GraphWidget GOffice.GraphWidget Gtk.Buildable->Gtk.Widget Gtk.Container Gtk.Container Gtk.Layout Gtk.Layout Gtk.Container->Gtk.Layout Gtk.Layout->GOffice.GraphWidget Gtk.Scrollable->Gtk.Layout Gtk.Widget->Gtk.Container

Subclasses:

None

Methods

Inherited:

Gtk.Layout (10), Gtk.Container (35), Gtk.Widget (278), GObject.Object (37), Gtk.Buildable (10), Gtk.Scrollable (9)

Structs:

Gtk.ContainerClass (5), Gtk.WidgetClass (12), GObject.ObjectClass (5)

class

new (graph)

get_chart ()

get_graph ()

get_renderer ()

set_size_mode (size_mode, width, height)

Virtual Methods

Inherited:

Gtk.Container (10), Gtk.Widget (82), GObject.Object (7), Gtk.Buildable (10), Gtk.Scrollable (1)

Properties

Inherited:

Gtk.Layout (2), Gtk.Container (3), Gtk.Widget (39), Gtk.Scrollable (4)

Name

Type

Flags

Short Description

aspect-ratio

float

r/w/c

Aspect ratio for rendering the graph, used only if greater than 0.

graph

GOffice.GraphGraph

r/w/co

The graph to render.

hres

float

r/w/co

Assumed horizontal screen resolution in pixels per inch.

vres

float

r/w/co

Assumed vertical screen resolution in pixels per inch.

Child Properties

Inherited:

Gtk.Layout (2)

Style Properties

Inherited:

Gtk.Widget (17)

Signals

Inherited:

Gtk.Container (4), Gtk.Widget (69), GObject.Object (1)

Fields

Inherited:

Gtk.Container (4), Gtk.Widget (69), GObject.Object (1)

Class Details

class GOffice.GraphWidget(**kwargs)
Bases:

Gtk.Layout

Abstract:

No

Structure:

GOffice.GraphWidgetClass

classmethod new(graph)
Parameters:

graph (GOffice.GraphGraph) – GOffice.GraphGraph

Returns:

the newly created GOffice.GraphWidget.

Return type:

Gtk.Widget

Creates a new GOffice.GraphWidget with an embedded GOffice.GraphGraph. If graph is None, the graph will be auto-created, and a GOffice.GraphChart will be added graph.

get_chart()
Returns:

the GOffice.GraphChart created by GOffice.GraphWidget.new().

Return type:

GOffice.GraphChart

get_graph()
Returns:

the GOffice.GraphGraph embedded in the widget.

Return type:

GOffice.GraphGraph

get_renderer()
Returns:

the GOffice.GraphRenderer used by the widget.

Return type:

GOffice.GraphRenderer

set_size_mode(size_mode, width, height)
Parameters:

Sets the size mode of the GOffice.GraphWidget. It is used to determine the size and position of the drawn chart. The following sizing modes are supported:

GOffice.GraphWidgetSizeMode.FIT, aspect ratio set. The aspect ratio is guaranteed to be maintained, i.e. the graph is never squeezed, and will always fit into the visible area.

GOffice.GraphWidgetSizeMode.FIT, no aspect ratio set. The aspect ratio is adapted to make the graph exactly fit into the visible area.

GOffice.GraphWidgetSizeMode.FIT_WIDTH, aspect ratio set. The aspect ratio is guaranteed to be maintained, i.e. the graph is never squezzed, and will always occupy the whole width of the visible area.

GOffice.GraphWidgetSizeMode.FIT_HEIGHT, aspect ratio set. The aspect ratio is guaranteed to be maintained, i.e. the graph is never squezzed, and will always occupy the whole height of the visible area.

GO_GRAPH_WIDGET_SIZE_MODE_FIT_FIXED_SIZE, no aspect ratio set. The graph will occupy the area specified by width/height, its aspect ratio will be determined by height/width.

Property Details

GOffice.GraphWidget.props.aspect_ratio
Name:

aspect-ratio

Type:

float

Default Value:

-1.0

Flags:

READABLE, WRITABLE, CONSTRUCT

Aspect ratio for rendering the graph, used only if greater than 0.

GOffice.GraphWidget.props.graph
Name:

graph

Type:

GOffice.GraphGraph

Default Value:

None

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

The graph to render.

GOffice.GraphWidget.props.hres
Name:

hres

Type:

float

Default Value:

96.0

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

Assumed horizontal screen resolution in pixels per inch.

GOffice.GraphWidget.props.vres
Name:

vres

Type:

float

Default Value:

96.0

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

Assumed vertical screen resolution in pixels per inch.