
    MiC                       S r SSKJr  SSKJr  SSKJrJrJrJ	r	  SSK
Jr  SSKJr  SSKJr  SSKJrJr  SS	KJr   " S
 S\5      r " S S\5      r " S S\5      r " S S\5      r " S S\5      r " S S\5      r " S S\5      rg)zAxis-related chart objects.    )annotations)ChartFormat)XL_AXIS_CROSSESXL_CATEGORY_TYPEXL_TICK_LABEL_POSITIONXL_TICK_MARK)qn)ST_Orientation)ElementProxy)Font	TextFrame)lazypropertyc                  t  ^  \ rS rSrSrU 4S jr\S 5       r\S 5       r	\S 5       r
\
R                  S 5       r
\S 5       r\R                  S	 5       r\S
 5       r\R                  S 5       r\S 5       r\S 5       r\R                  S 5       r\S 5       r\R                  S 5       r\S 5       r\R                  S 5       r\S 5       r\R                  S 5       r\S 5       r\R                  S 5       r\S 5       r\S 5       r\R                  S 5       r\S 5       r\R                  S 5       rSrU =r$ )	_BaseAxis   zKBase class for chart axis objects. All axis objects share these properties.c                B   > [         [        U ]  5         Xl        Xl        g N)superr   __init___element_xAxselfxAx	__class__s     i/var/www/eduai.edurigo.com/storigo/production/storigo_env/lib/python3.13/site-packages/pptx/chart/axis.pyr   _BaseAxis.__init__   s    i')	    c                H    [        U R                  R                  5       5      $ )a  An |AxisTitle| object providing access to title properties.

Calling this property is destructive in the sense that it adds an
axis title element (`c:title`) to the axis XML if one is not already
present. Use :attr:`has_title` to test for presence of axis title
non-destructively.
)	AxisTitler   get_or_add_titler   s    r   
axis_title_BaseAxis.axis_title   s     779::r   c                ,    [        U R                  5      $ )z}
The |ChartFormat| object providing access to the shape formatting
properties of this axis, such as its line color and fill.
r   r   r"   s    r   format_BaseAxis.format&   s     4==))r   c                4    U R                   R                  c  gg)z
Read/write boolean value specifying whether this axis has gridlines
at its major tick mark locations. Assigning |True| to this property
causes major gridlines to be displayed. Assigning |False| causes them
to be removed.
FT)r   majorGridlinesr"   s    r   has_major_gridlines_BaseAxis.has_major_gridlines.        ==''/r   c                    [        U5      SL a  U R                  R                  5         g U R                  R                  5         g NT)boolr   get_or_add_majorGridlines_remove_majorGridlinesr   values     r   r+   r,   :   .    ;$MM335MM002r   c                4    U R                   R                  c  gg)z
Read/write boolean value specifying whether this axis has gridlines
at its minor tick mark locations. Assigning |True| to this property
causes minor gridlines to be displayed. Assigning |False| causes them
to be removed.
FT)r   minorGridlinesr"   s    r   has_minor_gridlines_BaseAxis.has_minor_gridlinesA   r-   r   c                    [        U5      SL a  U R                  R                  5         g U R                  R                  5         g r/   )r0   r   get_or_add_minorGridlines_remove_minorGridlinesr3   s     r   r8   r9   M   r5   r   c                4    U R                   R                  c  gg)zRead/write boolean specifying whether this axis has a title.

|True| if this axis has a title, |False| otherwise. Assigning |True|
causes an axis title to be added if not already present. Assigning
|False| causes any existing title to be deleted.
FT)r   titler"   s    r   	has_title_BaseAxis.has_titleT   s     ==&r   c                    [        U5      SL a  U R                  R                  5         g U R                  R                  5         g r/   )r0   r   r!   _remove_titler3   s     r   r?   r@   `   s.    ;$MM**,MM'')r   c                ,    [        U R                  5      $ )zM
The |MajorGridlines| object representing the major gridlines for
this axis.
)MajorGridlinesr   r"   s    r   major_gridlines_BaseAxis.major_gridlinesg   s     dmm,,r   c                l    U R                   R                  nUc  [        R                  $ UR                  $ )zd
Read/write :ref:`XlTickMark` value specifying the type of major tick
mark to display on this axis.
)r   majorTickMarkr   CROSSval)r   rH   s     r   major_tick_mark_BaseAxis.major_tick_marko   1     33 %%%   r   c                    U R                   R                  5         U[        R                  L a  g U R                   R	                  US9  g NrJ   )r   _remove_majorTickMarkr   rI   _add_majorTickMarkr3   s     r   rK   rL   z   8    ++-L&&&((U(3r   c                B    U R                   R                  R                  $ )a=  
Read/write float value specifying the upper limit of the value range
for this axis, the number at the top or right of the vertical or
horizontal value scale, respectively. The value |None| indicates the
upper limit should be determined automatically based on the range of
data point values associated with the axis.
r   scalingmaximumr"   s    r   maximum_scale_BaseAxis.maximum_scale        }}$$,,,r   c                <    U R                   R                  nXl        g r   rU   r   r4   rV   s      r   rX   rY          --''r   c                B    U R                   R                  R                  $ )a-  
Read/write float value specifying lower limit of value range, the
number at the bottom or left of the value scale. |None| if no minimum
scale has been set. The value |None| indicates the lower limit should
be determined automatically based on the range of data point values
associated with the axis.
r   rV   minimumr"   s    r   minimum_scale_BaseAxis.minimum_scale   rZ   r   c                <    U R                   R                  nXl        g r   r_   r\   s      r   ra   rb      r]   r   c                l    U R                   R                  nUc  [        R                  $ UR                  $ )zZ
Read/write :ref:`XlTickMark` value specifying the type of minor tick
mark for this axis.
)r   minorTickMarkr   rI   rJ   )r   re   s     r   minor_tick_mark_BaseAxis.minor_tick_mark   rM   r   c                    U R                   R                  5         U[        R                  L a  g U R                   R	                  US9  g rO   )r   _remove_minorTickMarkr   rI   _add_minorTickMarkr3   s     r   rf   rg      rS   r   c                P    U R                   R                  [        R                  :H  $ )a  Read/write bool value specifying whether to reverse plotting order for axis.

For a category axis, this reverses the order in which the categories are
displayed. This may be desired, for example, on a (horizontal) bar-chart where
by default the first category appears at the bottom. Since we read from
top-to-bottom, many viewers may find it most natural for the first category to
appear on top.

For a value axis, it reverses the direction of increasing value from
bottom-to-top to top-to-bottom.
)r   orientationr
   MAX_MINr"   s    r   reverse_order_BaseAxis.reverse_order   s     }}((N,B,BBBr   c                ~    [        U5      SL a  [        R                  O[        R                  U R                  l        g r/   )r0   r
   rm   MIN_MAXr   rl   r3   s     r   rn   ro      s,     '+5kT&9N""~?U?U 	!r   c                ,    [        U R                  5      $ )z
The |TickLabels| instance providing access to axis tick label
formatting properties. Tick labels are the numbers appearing on
a value axis or the category names appearing on a category axis.
)
TickLabelsr   r"   s    r   tick_labels_BaseAxis.tick_labels   s     $--((r   c                    U R                   R                  nUc  [        R                  $ UR                  c  [        R                  $ UR                  $ )zk
Read/write :ref:`XlTickLabelPosition` value specifying where the tick
labels for this axis should appear.
)r   
tickLblPosr   NEXT_TO_AXISrJ   )r   rw   s     r   tick_label_position_BaseAxis.tick_label_position   sE     ]]--
)666>>!)666~~r   c                D    U R                   R                  5       nXl        g r   )r   get_or_add_tickLblPosrJ   )r   r4   rw   s      r   ry   rz      s    ]]88:
r   c                `    U R                   R                  nUc  gUR                  (       a  S$ S$ )z;
Read/write. |True| if axis is visible, |False| otherwise.
FT)r   delete_rJ   )r   deletes     r   visible_BaseAxis.visible   s,    
 &&>

u,,r   c                x    US;  a  [        SU-  5      eU R                  R                  5       nU(       + Ul        g )N)TFz-assigned value must be True or False, got: %s)
ValueErrorr   get_or_add_delete_rJ   )r   r4   r   s      r   r   r      s6    %LuTUU113Y
r   )r   r   )__name__
__module____qualname____firstlineno____doc__r   propertyr#   r   r'   r+   setterr8   r?   rE   rK   rX   ra   rf   rn   rt   ry   r   __static_attributes____classcell__r   s   @r   r   r      s'   U
 ; ; * * 	 	 3  3 	 	 3  3 	 	 * * - - ! ! 4 4 - -     - -     ! ! 4 4 C C 
 

 ) ) 
 
    - - ^^ r   r   c                     ^  \ rS rSrSrU 4S jr\S 5       r\S 5       r	\	R                  S 5       r	\S 5       rSrU =r$ )	r       z0Provides properties for manipulating axis title.c                8   > [         [        U ]  U5        Xl        g r   )r   r    r   _title)r   r>   r   s     r   r   AxisTitle.__init__   s    i'.r   c                ,    [        U R                  5      $ )z|ChartFormat| object providing access to shape formatting.

Return the |ChartFormat| object providing shape formatting properties
for this axis title, such as its line color and fill.
r&   r"   s    r   r'   AxisTitle.format   s     4==))r   c                4    U R                   R                  c  gg)a<  Read/write Boolean specifying presence of a text frame.

Return |True| if this axis title has a text frame, and |False|
otherwise. Assigning |True| causes a text frame to be added if not
already present. Assigning |False| causes any existing text frame to
be removed along with any text contained in the text frame.
FT)r   tx_richr"   s    r   has_text_frameAxisTitle.has_text_frame  s     ;;&r   c                    [        U5      SL a  U R                  R                  5         g U R                  R                  5         g r/   )r0   r   get_or_add_tx_rich
_remove_txr3   s     r   r   r     s.    ;$KK**,KK""$r   c                L    U R                   R                  5       n[        X5      $ )a  |TextFrame| instance for this axis title.

Return a |TextFrame| instance allowing read/write access to the text
of this axis title and its text formatting properties. Accessing this
property is destructive as it adds a new text frame if not already
present.
)r   r   r   )r   richs     r   
text_frameAxisTitle.text_frame  s!     {{--/$$r   )r   )r   r   r   r   r   r   r   r'   r   r   r   r   r   r   r   s   @r   r    r       sa    : * * 
 
 % % 	% 	%r   r    c                  (    \ rS rSrSr\S 5       rSrg)CategoryAxisi&  zA category axis of a chart.c                "    [         R                  $ )z
A member of :ref:`XlCategoryType` specifying the scale type of this
axis. Unconditionally ``CATEGORY_SCALE`` for a |CategoryAxis| object.
)r   CATEGORY_SCALEr"   s    r   category_typeCategoryAxis.category_type)  s      ...r    Nr   r   r   r   r   r   r   r   r   r   r   r   r   &  s    %/ /r   r   c                  (    \ rS rSrSr\S 5       rSrg)DateAxisi2  zA category axis with dates as its category labels.

This axis-type has some special display behaviors such as making length of equal
periods equal and normalizing month start dates despite unequal month lengths.
c                "    [         R                  $ )z
A member of :ref:`XlCategoryType` specifying the scale type of this
axis. Unconditionally ``TIME_SCALE`` for a |DateAxis| object.
)r   
TIME_SCALEr"   s    r   r   DateAxis.category_type9  s      ***r   r   Nr   r   r   r   r   r   2  s     + +r   r   c                  <   ^  \ rS rSrSrU 4S jr\S 5       rSrU =r	$ )rD   iB  zNProvides access to the properties of the major gridlines appearing on an axis.c                8   > [         [        U ]  U5        Xl        g r   )r   rD   r   r   r   s     r   r   MajorGridlines.__init__E  s    nd,S1	r   c                L    U R                   R                  5       n[        U5      $ )zy
The |ChartFormat| object providing access to the shape formatting
properties of this data point, such as line and fill.
)r   r1   r   )r   r*   s     r   r'   MajorGridlines.formatI  s!     <<>>**r   )r   )
r   r   r   r   r   r   r   r'   r   r   r   s   @r   rD   rD   B  s    X + +r   rD   c                     ^  \ rS rSrSrU 4S jr\S 5       r\S 5       r	\	R                  S 5       r	\S 5       r\R                  S 5       r\S	 5       r\R                  S
 5       rSrU =r$ )rs   iS  zHA service class providing access to formatting of axis tick mark labels.c                6   > [         [        U ]  5         Xl        g r   )r   rs   r   r   )r   xAx_elmr   s     r   r   TickLabels.__init__V  s    j$(*r   c                H    U R                   R                  n[        U5      nU$ )zq
The |Font| object that provides access to the text properties for
these tick labels, such as bold, italic, etc.
)r   defRPrr   )r   r   fonts      r   r   TickLabels.fontZ  s!     %%F|r   c                N    U R                   R                  nUc  gUR                  $ )a  
Read/write string (e.g. "$#,##0.00") specifying the format for the
numbers on this axis. The syntax for these strings is the same as it
appears in the PowerPoint or Excel UI. Returns 'General' if no number
format has been set. Note that this format string has no effect on
rendered tick labels when :meth:`number_format_is_linked` is |True|.
Assigning a format string to this property automatically sets
:meth:`number_format_is_linked` to |False|.
General)r   numFmt
formatCode)r   r   s     r   number_formatTickLabels.number_formatd  s'     %%>   r   c                R    U R                   R                  5       nXl        SU l        g )NF)r   get_or_add_numFmtr   number_format_is_linkedr   r4   r   s      r   r   r   t  s"    002!',$r   c                n    U R                   R                  nUc  gUR                  nUc  gUR                  $ )z
Read/write boolean specifying whether number formatting should be
taken from the source spreadsheet rather than the value of
:meth:`number_format`.
FT)r   r   sourceLinked)r   r   souceLinkeds      r   r   "TickLabels.number_format_is_linkedz  s;     %%>))"""r   c                D    U R                   R                  5       nXl        g r   )r   r   r   r   s      r   r   r     s    002#r   c                N    U R                   R                  nUc  gUR                  $ )z
Read/write int value in range 0-1000 specifying the spacing between
the tick mark labels and the axis as a percentange of the default
value. 100 if no label offset setting is present.
d   )r   	lblOffsetrJ   )r   r   s     r   offsetTickLabels.offset  s&     MM++	}}r   c                    U R                   R                  [        S5      :w  a  [        S5      eU R                   R	                  5         US:X  a  g U R                   R                  5       nXl        g )Nzc:catAxz"only a category axis has an offsetr   )r   tagr	   r   _remove_lblOffset_add_lblOffsetrJ   )r   r4   r   s      r   r   r     sU    ==9-ABB'')C<MM002	r   )r   r   )r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   s   @r   rs   rs   S  s    R    ! ! - -
 # # ##$ $$ 	 	 ]] r   rs   c                      \ rS rSrSr\S 5       r\R                  S 5       r\S 5       r\R                  S 5       r\S 5       r	\	R                  S 5       r	\S	 5       r
\
R                  S
 5       r
\S 5       rSrg)	ValueAxisi  zAn axis having continuous (as opposed to discrete) values.

The vertical axis is generally a value axis, however both axes of an XY-type chart
are value axes.
c                l    U R                   R                  nUc  [        R                  $ UR                  $ )z
Member of :ref:`XlAxisCrosses` enumeration specifying the point on
this axis where the other axis crosses, such as auto/zero, minimum,
or maximum. Returns `XL_AXIS_CROSSES.CUSTOM` when a specific numeric
crossing point (e.g. 1.5) is defined.
)
_cross_xAxcrossesr   CUSTOMrJ   )r   r   s     r   r   ValueAxis.crosses  s.     //))?"))){{r   c                   U R                   nU[        R                  :X  a  UR                  b  g UR	                  5         UR                  5         U[        R                  :X  a  UR                  SS9  g UR                  US9  g )Ng        rP   )r   r   r   	crossesAt_remove_crosses_remove_crossesAt_add_crossesAt_add_crossesr   r4   	cross_xAxs      r   r   r     sp    OO	O***"".!!###%O***$$$-""u"-r   c                N    U R                   R                  nUc  gUR                  $ )zq
Numeric value on this axis at which the perpendicular axis crosses.
Returns |None| if no crossing value is set.
N)r   r   rJ   )r   r   s     r   
crosses_atValueAxis.crosses_at  s&     OO--	}}r   c                    U R                   nUR                  5         UR                  5         Uc  g UR                  US9  g rO   )r   r   r   r   r   s      r   r   r     s<    OO	!!###%=  U +r   c                N    U R                   R                  nUc  gUR                  $ )z
The float number of units between major tick marks on this value
axis. |None| corresponds to the 'Auto' setting in the UI, and
specifies the value should be calculated by PowerPoint based on the
underlying chart data.
N)r   	majorUnitrJ   )r   r   s     r   
major_unitValueAxis.major_unit  &     MM++	}}r   c                r    U R                   R                  5         Uc  g U R                   R                  US9  g rO   )r   _remove_majorUnit_add_majorUnitr3   s     r   r   r     /    '')=$$$/r   c                N    U R                   R                  nUc  gUR                  $ )z
The float number of units between minor tick marks on this value
axis. |None| corresponds to the 'Auto' setting in the UI, and
specifies the value should be calculated by PowerPoint based on the
underlying chart data.
N)r   	minorUnitrJ   )r   r   s     r   
minor_unitValueAxis.minor_unit  r   r   c                r    U R                   R                  5         Uc  g U R                   R                  US9  g rO   )r   _remove_minorUnit_add_minorUnitr3   s     r   r   r     r   r   c                    U R                   R                  R                  nSU-  nU R                   R                  U5      S   nUR	                  5       $ )zP
The axis element in the same group (primary/secondary) that crosses
this axis.
z9(../c:catAx | ../c:valAx | ../c:dateAx)/c:axId[@val="%d"]r   )r   crossAxrJ   xpath	getparent)r   
crossAx_idexpr
cross_axIds       r   r   ValueAxis._cross_xAx  sK     ]]**..
JZW]]((.q1
##%%r   r   N)r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r     s     
 
 ^^
. 
.   , , 
 
 0 0 
 
 0 0 & &r   r   N)r   
__future__r   pptx.dml.chtfmtr   pptx.enum.chartr   r   r   r   pptx.oxml.nsr	   pptx.oxml.simpletypesr
   pptx.sharedr   pptx.text.textr   r   	pptx.utilr   objectr   r    r   r   rD   rs   r   r   r   r   <module>r     s    ! " '   0 $ * "_ _D.% .%b	/9 	/+y + +\ +"O Odf&	 f&r   