AGW Logo

agw_title PieCtrl

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

hierarchy Inheritance Diagram

Inheritance diagram for: PieCtrl

Inheritance diagram of PieCtrl


subclasses Known Subclasses


appearance Control Appearance


PieCtrl

PieCtrl


method_summary Methods Summary

__init__Default class constructor.
DrawDraws all the sectors of PieCtrl.
DrawPartsDraws the PieCtrl external edges.
GetAngleReturns the orientation angle for PieCtrl, in radians.
GetBackColourReturns the PieCtrl background colour.
GetBackgroundReturns the PieCtrl background image.
GetHeightReturns the height (in pixels) of the PieCtrl.
GetLegendReturns the PieCtrl legend.
GetPartAnglesReturns the angles associated to all segments.
GetRotationAngleReturns the angle at which the first sector starts, in radians.
GetShowEdgesReturns whether the PieCtrl edges are visible or not.
OnPaintHandles the wx.EVT_PAINT event for PieCtrl.
OnSizeHandles the wx.EVT_SIZE event for PieCtrl.
RecreateCanvasRecreates the PieCtrl container (canvas).
SetAngleSets the orientation angle for PieCtrl.
SetBackColourSets the PieCtrl background colour.
SetBackgroundSets the PieCtrl background image.
SetHeightSets the height (in pixels) of the PieCtrl.
SetRotationAngleSets the angle at which the first sector starts.
SetShowEdgesSets whether the PieCtrl edges are visible or not.

API Class API

class PieCtrl(wx.Window)[source]

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



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

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(pdc)[source]

Draws all the sectors of PieCtrl.

Parameters:dc – an instance of wx.DC.


DrawParts(dc, cx, cy, w, h)[source]

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()[source]

Returns the orientation angle for PieCtrl, in radians.



GetBackColour()[source]

Returns the PieCtrl background colour.



GetBackground()[source]

Returns the PieCtrl background image.



GetHeight()[source]

Returns the height (in pixels) of the PieCtrl.



GetLegend()[source]

Returns the PieCtrl legend.



GetPartAngles()[source]

Returns the angles associated to all segments.



GetRotationAngle()[source]

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



GetShowEdges()[source]

Returns whether the PieCtrl edges are visible or not.



OnPaint(event)[source]

Handles the wx.EVT_PAINT event for PieCtrl.

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


OnSize(event)[source]

Handles the wx.EVT_SIZE event for PieCtrl.

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


RecreateCanvas()[source]

Recreates the PieCtrl container (canvas).



SetAngle(angle)[source]

Sets the orientation angle for PieCtrl.

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


SetBackColour(colour)[source]

Sets the PieCtrl background colour.

Parameters:colour – a valid wx.Colour object.


SetBackground(bmp)[source]

Sets the PieCtrl background image.

Parameters:bmp – a valid wx.Bitmap object.


SetHeight(value)[source]

Sets the height (in pixels) of the PieCtrl.

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


SetRotationAngle(angle)[source]

Sets the angle at which the first sector starts.

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


SetShowEdges(value=True)[source]

Sets whether the PieCtrl edges are visible or not.

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

Table Of Contents

Previous topic

piectrl

Next topic

PieCtrlLegend