.. wxPython Phoenix documentation

   This file was generated by Phoenix's sphinx generator and associated
   tools, do not edit by hand.

   Copyright: (c) 2011-2020 by Total Control Software
   License:   wxWindows License

.. include:: headings.inc

.. currentmodule:: wx.lib.agw.piectrl

.. highlight:: python



.. _wx.lib.agw.piectrl.PieCtrl:

==========================================================================================================================================
|phoenix_title|  **wx.lib.agw.piectrl.PieCtrl**
==========================================================================================================================================

:class:`PieCtrl` is somewhat a "static" control, that you may create in order to display
a simple pie chart on a :class:`Panel` or similar.



|

|class_hierarchy| Class Hierarchy
=================================

.. raw:: html

   <div id="toggleBlock" onclick="return toggleVisibility(this)" class="closed" style="cursor:pointer;">
   <img id="toggleBlock-trigger" src="_static/images/closed.png"/>
   Inheritance diagram for class <strong>PieCtrl</strong>:
   </div>
   <div id="toggleBlock-summary" style="display:block;"></div>
   <div id="toggleBlock-content" style="display:none;">
   <p class="graphviz">
   <center><img src="_static/images/inheritance/wx.lib.agw.piectrl.PieCtrl_inheritance.svg" alt="Inheritance diagram of PieCtrl" usemap="#dummy" class="inheritance"/></center>
   <script type="text/javascript">toggleVisibilityOnLoad(document.getElementById('toggleBlock'))</script>
   <map id="dummy" name="dummy"> <area shape="rect" id="node1" href="wx.lib.agw.piectrl.PieCtrl.html" title="PieCtrl is somewhat a 'static' control, that you may create in order to display" alt="" coords="20,313,223,341"/> <area shape="rect" id="node2" href="wx.Window.html" title="wx.Window  is the base class for all windows and represents any visible object on screen." alt="" coords="66,236,177,265"/> <area shape="rect" id="node3" href="wx.WindowBase.html" title="wx.WindowBase" alt="" coords="48,159,195,188"/> <area shape="rect" id="node4" href="wx.EvtHandler.html" title="A class that can handle events from the windowing system." alt="" coords="55,82,188,111"/> <area shape="rect" id="node5" href="wx.Object.html" title="This is the root class of many of the wxWidgets classes." alt="" coords="5,5,104,34"/> <area shape="rect" id="node6" href="wx.Trackable.html" title="Add-on base class for a trackable object." alt="" coords="128,5,251,34"/> </map> 
   </p>
   </div>

|


|appearance| Control Appearance
===============================

|

.. container:: control-appearance-figures

   .. figure:: _static/images/widgets/fullsize/wxmsw/wx.lib.agw.piectrl.piectrl.png
      :alt: wxMSW
      :figclass: appearance-figure

      **wxMSW**


   .. figure:: _static/images/widgets/fullsize/wxmac/../no_appearance.png
      :alt: wxMAC
      :figclass: appearance-figure

      **wxMAC**


   .. figure:: _static/images/widgets/fullsize/wxgtk/wx.lib.agw.piectrl.piectrl.png
      :alt: wxGTK
      :figclass: appearance-figure

      **wxGTK**

|




|sub_classes| Known Subclasses
==============================

:class:`wx.lib.agw.piectrl.ProgressPie`

|


|super_classes| Known Superclasses
==================================

:class:`wx.Window`

|


|method_summary| Methods Summary
================================

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


|


|api| Class API
===============


.. class:: PieCtrl(wx.Window)

   :class:`PieCtrl` is somewhat a "static" control, that you may create in order to display
   a simple pie chart on a :class:`Panel` or similar.

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

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


   .. method:: Draw(self, dc)

      Draws all the sectors of :class:`PieCtrl`.
      
      :param `dc`: an instance of :class:`wx.DC`.


   .. method:: DrawParts(self, dc, cx, cy, w, h)

      Draws the :class:`PieCtrl` external edges.
      
      :param `dc`: an instance of :class:`wx.DC`;
      :param `cx`: the part `x` coordinate;
      :param `cy`: the part `y` coordinate;
      :param `w`: the control's width;
      :param `h`: the control's height.


   .. method:: GetAngle(self)

      Returns the orientation angle for :class:`PieCtrl`, in radians. 


   .. method:: GetBackColour(self)

      Returns the :class:`PieCtrl` background colour. 


   .. method:: GetBackground(self)

      Returns the :class:`PieCtrl` background image. 


   .. method:: GetHeight(self)

      Returns the height (in pixels) of the :class:`PieCtrl`. 


   .. method:: GetLegend(self)

      Returns the :class:`PieCtrl` legend. 


   .. method:: GetPartAngles(self)

      Returns the angles associated to all segments. 


   .. method:: GetRotationAngle(self)

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


   .. method:: GetShowEdges(self)

      Returns whether the :class:`PieCtrl` edges are visible or not. 


   .. method:: OnPaint(self, event)

      Handles the ``wx.EVT_PAINT`` event for :class:`PieCtrl`.
      
      :param `event`: a :class:`PaintEvent` event to be processed.


   .. method:: OnSize(self, event)

      Handles the ``wx.EVT_SIZE`` event for :class:`PieCtrl`.
      
      :param `event`: a :class:`wx.SizeEvent` event to be processed.


   .. method:: RecreateCanvas(self)

      Recreates the :class:`PieCtrl` container (canvas). 


   .. method:: SetAngle(self, angle)

      Sets the orientation angle for :class:`PieCtrl`.
      
      :param `angle`: the orientation angle for :class:`PieCtrl`, in radians.


   .. method:: SetBackColour(self, colour)

      Sets the :class:`PieCtrl` background colour.
      
      :param `colour`: a valid :class:`wx.Colour` object.


   .. method:: SetBackground(self, bmp)

      Sets the :class:`PieCtrl` background image.
      
      :param `bmp`: a valid :class:`wx.Bitmap` object.


   .. method:: SetHeight(self, value)

      Sets the height (in pixels) of the :class:`PieCtrl`.
      
      :param `value`: the new height of the widget, in pixels.


   .. method:: SetRotationAngle(self, angle)

      Sets the angle at which the first sector starts.
      
      :param `angle`: the first sector angle, in radians.


   .. method:: SetShowEdges(self, value=True)

      Sets whether the :class:`PieCtrl` edges are visible or not.
      
      :param `value`: ``True`` to show the edges, ``False`` to hide them.


