
    hi	                    V    d Z ddlmZ ddlmZ ddlmZ ddlmZ  G d de	          Z
dS )	zLegend of a chart.    )annotations)XL_LEGEND_POSITION)Font)lazypropertyc                       e Zd ZdZ fdZed             Zed             Zej	        d             Zed             Z
e
j	        d             Z
ed             Zej	        d	             Z xZS )
LegendzP
    Represents the legend in a chart. A chart can have at most one legend.
    c                d    t          t          |                                            || _        d S N)superr   __init___element)self
legend_elm	__class__s     i/var/www/development/aibuddy-work/election-extract/venv/lib/python3.11/site-packages/pptx/chart/legend.pyr   zLegend.__init__   s*    fd$$&&&"    c                <    | j         j        }t          |          }|S )z
        The |Font| object that provides access to the text properties for
        this legend, such as bold, italic, etc.
        )r   defRPrr   )r   r   fonts      r   r   zLegend.font   s     %F||r   c                    | j         j        S )a+  
        Adjustment of the x position of the legend from its default.
        Expressed as a float between -1.0 and 1.0 representing a fraction of
        the chart width. Negative values move the legend left, positive
        values move it to the right. |None| if no setting is specified.
        r   horz_offset)r   s    r   r   zLegend.horz_offset   s     }((r   c                    || j         _        d S r
   r   r   values     r   r   zLegend.horz_offset'   s    $)!!!r   c                0    | j         j        }|dS |j        S )a  |True| if legend should be located inside plot area.

        Read/write boolean specifying whether legend should be placed inside
        the plot area. In many cases this will cause it to be superimposed on
        the chart itself. Assigning |None| to this property causes any
        `c:overlay` element to be removed, which is interpreted the same as
        |True|. This use case should rarely be required and assigning
        a boolean value is recommended.
        NT)r   overlayval)r   r   s     r   include_in_layoutzLegend.include_in_layout+   s      -'?4{r   c                    || j                                          d S t          |          | j                                         _        d S r
   )r   _remove_overlayboolget_or_add_overlayr   r   s     r   r   zLegend.include_in_layout;   sB    =M))+++F15e((**...r   c                D    | j         j        }|t          j        S |j        S )z
        Read/write :ref:`XlLegendPosition` enumeration value specifying the
        general region of the chart in which to place the legend.
        )r   	legendPosr   RIGHTr   )r   r%   s     r   positionzLegend.positionB   s%     M+	%++}r   c                B    || j                                         _        d S r
   )r   get_or_add_legendPosr   )r   r'   s     r   r'   zLegend.positionM   s    3;**,,000r   )__name__
__module____qualname____doc__r   r   r   propertyr   setterr   r'   __classcell__)r   s   @r   r   r   
   s	        # # # # #   \ ) ) X) * * *   X = = =   X _< < _< < < < <r   r   N)r-   
__future__r   pptx.enum.chartr   pptx.text.textr   	pptx.utilr   objectr    r   r   <module>r7      s      " " " " " " . . . . . .       " " " " " "E< E< E< E< E<V E< E< E< E< E<r   