Module wx.lib.agw.piectrl
Description:
PieCtrl/ProgressPie are simple classes that reproduce the behavior of a pie
chart. They use only pure wxPython classes/methods, without external dependencies.
PieCtrl is somewhat a "static" control, that you may create in order to display
a simple pie chart on a wx.Panel or similar. ProgressPie tries to emulate the
behavior of wx.ProgressDialog, but using a pie chart instead of a gauge.
Usage:
An example of use of PieCtrl is as follows:
# create a simple PieCtrl with 3 sectors
mypie = PieCtrl(panel, -1, wx.DefaultPosition, wx.Size(180,270))
part = PiePart()
part.SetLabel("serieslabel_1")
part.SetValue(300)
part.SetColour(wx.Colour(200, 50, 50))
mypie._series.append(part)
part = PiePart()
part.SetLabel("series label 2")
part.SetValue(200)
part.SetColour(wx.Colour(50, 200, 50))
mypie._series.append(part)
part = PiePart()
part.SetLabel("helloworld label 3")
part.SetValue(50)
part.SetColour(wx.Colour(50, 50, 200))
mypie._series.append(part)
An example of use of ProgressPie is as follows:
# create a progresspie
MyProgressPie = ProgressPie(panel, 100, 50, -1, wx.DefaultPosition,
wx.Size(180, 200), wx.SIMPLE_BORDER)
MyProgressPie.SetBackColour(wx.Colour(150, 200, 255))
myprogresspie.SetFilledcolour(wx.Colour(255, 0, 0))
MyProgressPie.SetUnfilledColour(wx.WHITE)
MyProgressPie.SetHeight(20)
For the full listing of the input parameters, see the PieCtrl __init__()
method.
Methods and Settings:
With PieCtrl you can:
- Create a PieCtrl with different sectors;
- Set the sector values, colours and labels;
- Assign a legend to the PieCtrl;
- Use an image as the PieCtrl background;
- Change the vertical rotation (perspective) of the PieCtrl;
- Show/hide the segment edges.
For more info on methods and initial styles, please refer to the __init__()
method for PieCtrl or to the specific functions.
PieCtrl control is freeware and distributed under the wxPython license.
Latest revision: Andrea Gavana @ 15 Oct 2008, 10.00 GMT
Version 0.1