Phoenix Logo

phoenix_title wx.lib.agw.piectrl.PieCtrl

PieCtrl is somewhat a “static” control, that you may create in order to display a simple pie chart on a Panel or similar.


class_hierarchy Class Hierarchy

Inheritance diagram for class PieCtrl:


appearance Control Appearance


wxMSW

wxMSW

wxMAC

wxMAC

wxGTK

wxGTK


super_classes Known Superclasses

wx.Window


method_summary Methods Summary

__init__ Default class constructor.
Draw Draws all the sectors of PieCtrl.
DrawParts Draws the PieCtrl external edges.
GetAngle Returns the orientation angle for PieCtrl, in radians.
GetBackColour Returns the PieCtrl background colour.
GetBackground Returns the PieCtrl background image.
GetHeight Returns the height (in pixels) of the PieCtrl.
GetLegend Returns the PieCtrl legend.
GetPartAngles Returns the angles associated to all segments.
GetRotationAngle Returns the angle at which the first sector starts, in radians.
GetShowEdges Returns whether the PieCtrl edges are visible or not.
OnPaint Handles the wx.EVT_PAINT event for PieCtrl.
OnSize Handles the wx.EVT_SIZE event for PieCtrl.
RecreateCanvas Recreates the PieCtrl container (canvas).
SetAngle Sets the orientation angle for PieCtrl.
SetBackColour Sets the PieCtrl background colour.
SetBackground Sets the PieCtrl background image.
SetHeight Sets the height (in pixels) of the PieCtrl.
SetRotationAngle Sets the angle at which the first sector starts.
SetShowEdges Sets whether the PieCtrl edges are visible or not.

api Class API



class PieCtrl(wx.Window)

PieCtrl is somewhat a “static” control, that you may create in order to display a simple pie chart on a Panel or similar.


Methods



__init__(self, parent, id=wx.ID_ANY, pos=wx.DefaultPosition, size=wx.DefaultSize, style=0, name="PieCtrl")

Default class constructor.

Parameters:
  • parent – the PieCtrl parent. Must not be None;
  • id – window identifier. A value of -1 indicates a default value;
  • pos – the control position. A value of (-1, -1) indicates a default position, chosen by either the windowing system or wxPython, depending on platform;
  • size – the control size. A value of (-1, -1) indicates a default size, chosen by either the windowing system or wxPython, depending on platform;
  • style – the window style (unused);
  • name – the window name.


Draw(self, pdc)

Draws all the sectors of PieCtrl.

Parameters:dc – an instance of wx.DC.


DrawParts(self, dc, cx, cy, w, h)

Draws the PieCtrl external edges.

Parameters:
  • dc – an instance of wx.DC;
  • cx – the part x coordinate;
  • cy – the part y coordinate;
  • w – the control’s width;
  • h – the control’s height.


GetAngle(self)

Returns the orientation angle for PieCtrl, in radians.



GetBackColour(self)

Returns the PieCtrl background colour.



GetBackground(self)

Returns the PieCtrl background image.



GetHeight(self)

Returns the height (in pixels) of the PieCtrl.



GetLegend(self)

Returns the PieCtrl legend.



GetPartAngles(self)

Returns the angles associated to all segments.



GetRotationAngle(self)

Returns the angle at which the first sector starts, in radians.



GetShowEdges(self)

Returns whether the PieCtrl edges are visible or not.



OnPaint(self, event)

Handles the wx.EVT_PAINT event for PieCtrl.

Parameters:event – a PaintEvent event to be processed.


OnSize(self, event)

Handles the wx.EVT_SIZE event for PieCtrl.

Parameters:event – a wx.SizeEvent event to be processed.


RecreateCanvas(self)

Recreates the PieCtrl container (canvas).



SetAngle(self, angle)

Sets the orientation angle for PieCtrl.

Parameters:angle – the orientation angle for PieCtrl, in radians.


SetBackColour(self, colour)

Sets the PieCtrl background colour.

Parameters:colour – a valid wx.Colour object.


SetBackground(self, bmp)

Sets the PieCtrl background image.

Parameters:bmp – a valid wx.Bitmap object.


SetHeight(self, value)

Sets the height (in pixels) of the PieCtrl.

Parameters:value – the new height of the widget, in pixels.


SetRotationAngle(self, angle)

Sets the angle at which the first sector starts.

Parameters:angle – the first sector angle, in radians.


SetShowEdges(self, value=True)

Sets whether the PieCtrl edges are visible or not.

Parameters:valueTrue to show the edges, False to hide them.