
    li	                    N    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
y)	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                8    t         t        |           || _        y N)superr   __init___element)self
legend_elm	__class__s     O/var/www/html/eduruby.in/venv/lib/python3.12/site-packages/pptx/chart/legend.pyr   zLegend.__init__   s    fd$&"    c                H    | 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                   _        y r
   r   r   values     r   r   zLegend.horz_offset'   s    $)!r   c                L    | j                   j                  }|y|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.
        T)r   overlayval)r   r   s     r   include_in_layoutzLegend.include_in_layout+   s%     --''?{{r   c                    || j                   j                          y t        |      | j                   j                         _        y r
   )r   _remove_overlayboolget_or_add_overlayr   r   s     r   r   zLegend.include_in_layout;   s3    =MM))+15e((*.r   c                j    | 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/     MM++	%+++}}r   c                B    || j                   j                         _        y r
   )r   get_or_add_legendPosr   )r   r'   s     r   r'   zLegend.positionM   s    3;**,0r   )__name__
__module____qualname____doc__r   r   r   propertyr   setterr   r'   __classcell__)r   s   @r   r   r   
   s    #   ) ) * *   = =   __< <r   r   N)r-   
__future__r   pptx.enum.chartr   pptx.text.textr   	pptx.utilr   objectr    r   r   <module>r7      s"     " .  "E<V E<r   