
    Mip3                    d   S r SSKJr  SSKJr  SSK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 " S S\5      r " S S\5      r " S S\5      rS r " S S \5      rg!)"zPlot-related objects.

A plot is known as a chart group in the MS API. A chart can have more than one plot overlayed on
each other, such as a line plot layered over a bar plot.
    )annotations)
Categories)
DataLabels)SeriesCollection)XL_CHART_TYPE)qn)	ST_BarDirST_Grouping)lazypropertyc                     ^  \ rS rSrSrU 4S jr\S 5       r\S 5       r	\S 5       r
\S 5       r\R                  S 5       r\S	 5       r\S
 5       r\R                  S 5       rSrU =r$ )	_BasePlot   z
A distinct plot that appears in the plot area of a chart. A chart may
have more than one plot, in which case they appear as superimposed
layers, such as a line plot appearing on top of a bar chart.
c                B   > [         [        U ]  5         Xl        X l        g N)superr   __init___element_chart)selfxChartchart	__class__s      i/var/www/eduai.edurigo.com/storigo/production/storigo_env/lib/python3.13/site-packages/pptx/chart/plot.pyr   _BasePlot.__init__   s    i')    c                ,    [        U R                  5      $ )a  
Returns a |category.Categories| sequence object containing
a |category.Category| object for each of the category labels
associated with this plot. The |category.Category| class derives from
``str``, so the returned value can be treated as a simple sequence of
strings for the common case where all you need is the labels in the
order they appear on the chart. |category.Categories| provides
additional properties for dealing with hierarchical categories when
required.
)r   r   r   s    r   
categories_BasePlot.categories   s     $--((r   c                    U R                   $ )z*
The |Chart| object containing this plot.
)r   r   s    r   r   _BasePlot.chart,   s    
 {{r   c                `    U R                   R                  nUc  [        S5      e[        U5      $ )zt
|DataLabels| instance providing properties and methods on the
collection of data labels associated with this plot.
z9plot has no data labels, set has_data_labels = True first)r   dLbls
ValueErrorr   )r   r#   s     r   data_labels_BasePlot.data_labels3   s/     ##=XYY%  r   c                2    U R                   R                  SL$ )z
Read/write boolean, |True| if the series has data labels. Assigning
|True| causes data labels to be added to the plot. Assigning False
removes any existing data labels.
N)r   r#   r   s    r   has_data_labels_BasePlot.has_data_labels>   s     }}""$..r   c                    [        U5      SL a  U R                  R                  5         gU R                  R                  c,  U R                  R	                  5       nSUR
                  l        gg)a*  
Add, remove, or leave alone the ``<c:dLbls>`` child element depending
on current state and assigned *value*. If *value* is |True| and no
``<c:dLbls>`` element is present, a new default element is added with
default child elements and settings. When |False|, any existing dLbls
element is removed.
FNT)boolr   _remove_dLblsr#   
_add_dLblsshowValval)r   valuer#   s      r   r(   r)   G   sS     ;%MM'')}}""*002$(! +r   c                ,    [        U R                  5      $ )zl
A sequence of |Series| objects representing the series in this plot,
in the order they appear in the plot.
)r   r   r   s    r   series_BasePlot.seriesW   s      ..r   c                N    U R                   R                  nUc  gUR                  $ )z
Read/write boolean value specifying whether to use a different color
for each of the points in this plot. Only effective when there is
a single series; PowerPoint automatically varies color by series when
more than one series is present.
T)r   
varyColorsr/   )r   r5   s     r   vary_by_categories_BasePlot.vary_by_categories_   s&     ]]--
~~r   c                T    [        U5      U R                  R                  5       l        g r   )r+   r   get_or_add_varyColorsr/   r   r0   s     r   r6   r7   l   s    48K++-1r   )r   r   )__name__
__module____qualname____firstlineno____doc__r   r   r   propertyr   r%   r(   setterr2   r6   __static_attributes____classcell__)r   s   @r   r   r      s    
 ) )   ! ! / / ) ) / / 
 
 @ @r   r   c                      \ rS rSrSrSrg)AreaPlotq   z
An area plot.
 Nr;   r<   r=   r>   r?   rB   rG   r   r   rE   rE   q       r   rE   c                      \ rS rSrSrSrg)
Area3DPlotw   z
A 3-dimensional area plot.
rG   NrH   rG   r   r   rK   rK   w   rI   r   rK   c                      \ rS rSrSr\S 5       r\R                  S 5       r\S 5       r\R                  S 5       rSr	g)	BarPlot}   z
A bar chart-style plot.
c                N    U R                   R                  nUc  gUR                  $ )z
Width of gap between bar(s) of each category, as an integer
percentage of the bar width. The default value for a new bar chart is
150, representing 150% or 1.5 times the width of a single bar.
   )r   gapWidthr/   )r   rR   s     r   	gap_widthBarPlot.gap_width   s&     ==))||r   c                D    U R                   R                  5       nXl        g r   )r   get_or_add_gapWidthr/   )r   r0   rR   s      r   rS   rT      s    ==446r   c                N    U R                   R                  nUc  gUR                  $ )aP  
Read/write int value in range -100..100 specifying a percentage of
the bar width by which to overlap adjacent bars in a multi-series bar
chart. Default is 0. A setting of -100 creates a gap of a full bar
width and a setting of 100 causes all the bars in a category to be
superimposed. A stacked bar plot has overlap of 100 by default.
r   )r   overlapr/   )r   rX   s     r   rX   BarPlot.overlap   s%     --''?{{r   c                    US:X  a  U R                   R                  5         gXR                   R                  5       l        g)zw
Set the value of the ``<c:overlap>`` child element to *int_value*,
or remove the overlap element if *int_value* is 0.
r   N)r   _remove_overlapget_or_add_overlapr/   r:   s     r   rX   rY      s1     A:MM))+16((*.r   rG   N)
r;   r<   r=   r>   r?   r@   rS   rA   rX   rB   rG   r   r   rN   rN   }   sa     	 	     ^^7 7r   rN   c                  L    \ rS rSrSr\S 5       r\R                  S 5       rSrg)
BubblePlot   z
A bubble chart plot.
c                N    U R                   R                  nUc  gUR                  $ )z
An integer between 0 and 300 inclusive indicating the percentage of
the default size at which bubbles should be displayed. Assigning
|None| produces the same behavior as assigning `100`.
d   )r   bubbleScaler/   )r   rb   s     r   bubble_scaleBubblePlot.bubble_scale   s&     mm//r   c                p    U R                   nUR                  5         Uc  g UR                  5       nXl        g r   )r   _remove_bubbleScale_add_bubbleScaler/   )r   r0   bubbleChartrb   s       r   rc   rd      s2    mm'')=!224r   rG   N)	r;   r<   r=   r>   r?   r@   rc   rA   rB   rG   r   r   r^   r^      s5     	 	    r   r^   c                      \ rS rSrSrSrg)DoughnutPlot   z
An doughnut plot.
rG   NrH   rG   r   r   rj   rj      rI   r   rj   c                      \ rS rSrSrSrg)LinePlot   z
A line chart-style plot.
rG   NrH   rG   r   r   rm   rm      rI   r   rm   c                      \ rS rSrSrSrg)PiePlot   z
A pie chart-style plot.
rG   NrH   rG   r   r   rp   rp      rI   r   rp   c                      \ rS rSrSrSrg)	RadarPlot   z
A radar-style plot.
rG   NrH   rG   r   r   rs   rs      rI   r   rs   c                      \ rS rSrSrSrg)XyPlot   z
An XY (scatter) plot.
rG   NrH   rG   r   r   rv   rv      rI   r   rv   c                    [        S5      [        [        S5      [        [        S5      [        [        S5      [        [        S5      [
        [        S5      [        [        S5      [        [        S5      [        [        S	5      [        0	U R                     nU" X5      $ ! [         a    [        S
U R                  -  5      ef = f)z_
Return an instance of the appropriate subclass of _BasePlot based on the
tagname of *xChart*.
zc:areaChartzc:area3DChartz
c:barChartzc:bubbleChartzc:doughnutChartzc:lineChartz
c:pieChartzc:radarChartzc:scatterChartzunsupported plot type %s)r   rE   rK   rN   r^   rj   rm   rp   rs   rv   tagKeyErrorr$   )r   r   PlotClss      r   PlotFactoryr|      s    
B}x|g !<}x|g~	 &

 **
 6!!  B3fjj@AABs   BB   #Cc                      \ rS rSrSr\S 5       r\S 5       r\S 5       r\S 5       r	\S 5       r
\S 5       r\S	 5       r\S
 5       r\S 5       r\S 5       rSrg)PlotTypeInspector   zw
"One-shot" service object that knows how to identify the type of a plot
as a member of the XL_CHART_TYPE enumeration.
c           
     n    U R                   U R                  U R                  U R                  U R                  U R
                  U R                  U R                  U R                  S.	UR                  R                     nU" U5      $ ! [         a#    [        SUR                  R                  -  5      ef = f)zW
Return the member of :ref:`XlChartType` that corresponds to the chart
type of *plot*.
)	rE   rK   rN   r^   rj   rm   rp   rs   rv   z#chart_type() not implemented for %s)_differentiate_area_chart_type!_differentiate_area_3d_chart_type_differentiate_bar_chart_type _differentiate_bubble_chart_type"_differentiate_doughnut_chart_type_differentiate_line_chart_type_differentiate_pie_chart_type_differentiate_radar_chart_type_differentiate_xy_chart_typer   r;   rz   NotImplementedError)clsplotchart_type_methods      r   
chart_typePlotTypeInspector.chart_type  s    	>>!CC<<!BB # F F>><< @@::
! nn%%
!' !&&	  	%58O8OO 	s   A=B -B4c                    [         R                  [        R                  [         R                  [        R
                  [         R                  [        R                  0UR                  R                     $ r   )
r
   STANDARDXLTHREE_D_AREASTACKEDTHREE_D_AREA_STACKEDPERCENT_STACKEDTHREE_D_AREA_STACKED_100r   grouping_valr   r   s     r   r   3PlotTypeInspector._differentiate_area_3d_chart_type  sS       "//!8!8'')D)D
 --
$
$	& 	&r   c                    [         R                  [        R                  [         R                  [        R
                  [         R                  [        R                  0UR                  R                     $ r   )
r
   r   r   AREAr   AREA_STACKEDr   AREA_STACKED_100r   r   r   s     r   r   0PlotTypeInspector._differentiate_area_chart_type#  sQ       "'''')<)<
 --
$
$	& 	&r   c                   UR                   nUR                  R                  [        R                  :X  ai  [
        R                  [        R                  [
        R                  [        R                  [
        R                  [        R                  0UR                     $ UR                  R                  [        R                  :X  ai  [
        R                  [        R                  [
        R                  [        R                   [
        R                  [        R"                  0UR                     $ [%        SUR                  R                  -  5      e)Nz"invalid barChart.barDir value '%s')r   barDirr/   r	   BARr
   	CLUSTEREDr   BAR_CLUSTEREDr   BAR_STACKEDr   BAR_STACKED_100r   COLCOLUMN_CLUSTEREDCOLUMN_STACKEDCOLUMN_STACKED_100r$   )r   r   barCharts      r   r   /PlotTypeInspector._differentiate_bar_chart_type+  s    ==??)--/%%r'7'7##R^^++R-?-? ##	% %
 ??)--/%%r':':##R%6%6++R-B-B ##	% %
 =@S@SSTTr   c                    S nUR                   nU" U5      nUc  [        R                  $ UR                  (       a  [        R                  $ [        R                  $ )Nc                @    U R                  S5      nU(       a  US   $ S $ )Nzc:ser/c:bubble3Dr   xpath)rh   resultss     r   first_bubble3DJPlotTypeInspector._differentiate_bubble_chart_type.<locals>.first_bubble3D>  s$    !''(:;G!(71:2d2r   )r   r   BUBBLEr/   BUBBLE_THREE_D_EFFECT)r   r   r   rh   bubble3Ds        r   r   2PlotTypeInspector._differentiate_bubble_chart_type<  sI    	3 mm!+.99<<+++yyr   c                    UR                   nUR                  S5      nU(       a  [        R                  $ [        R                  $ Nz./c:ser/c:explosion)r   r   r   DOUGHNUT_EXPLODEDDOUGHNUT)r   r   doughnutChart	explosions       r   r   4PlotTypeInspector._differentiate_doughnut_chart_typeK  s3    !''(=>	'0r##AbkkAr   c                  ^ UR                   mU4S jnU" 5       (       as  [        R                  [        R                  [        R
                  [        R                  [        R                  [        R                  0UR                   R                     $ [        R                  [        R                  [        R
                  [        R                  [        R                  [        R                  0UR                   R                     $ )Nc                 8   > TR                  S5      n U (       a  gg)Nz$c:ser/c:marker/c:symbol[@val="none"]FTr   )matches	lineCharts    r   has_line_markersJPlotTypeInspector._differentiate_line_chart_type.<locals>.has_line_markersU  s    oo&LMGr   )r   r
   r   r   LINE_MARKERSr   LINE_MARKERS_STACKEDr   LINE_MARKERS_STACKED_100r   LINELINE_STACKEDLINE_STACKED_100)r   r   r   r   s      @r   r   0PlotTypeInspector._differentiate_line_chart_typeQ  s    MM		 $$boo##R%<%<++R-H-H mm((	* * $$bgg##R__++R-@-@ mm((	* *r   c                    UR                   nUR                  S5      nU(       a  [        R                  $ [        R                  $ r   )r   r   r   PIE_EXPLODEDPIE)r   r   pieChartr   s       r   r   /PlotTypeInspector._differentiate_pie_chart_typeh  s/    ==NN#89	"+r77r   c                  ^ UR                   mTR                  S5      S   R                  S5      nU4S jnUc  [        R                  $ US:X  a  [        R
                  $ U" 5       (       a  [        R                  $ [        R                  $ )Nzc:radarStyler   r/   c                 h   > TR                  S5      n U (       a  U S   R                  S5      S:X  a  ggNzc:ser/c:marker/c:symbolr   r/   noneTFr   get)r   
radarCharts    r   	noMarkersDPlotTypeInspector._differentiate_radar_chart_type.<locals>.noMarkerss  s1     &&'@AG71:>>%0F:r   filled)r   r   r   r   RADARRADAR_FILLEDRADAR_MARKERS)r   r   radar_styler   r   s       @r   r   1PlotTypeInspector._differentiate_radar_chart_typen  sp    ]]
 &&~6q9==eD	 88O("??";;88Or   c                  ^ UR                   mU4S jnU4S jnTR                  S5      S   R                  S5      nUS:X  aH  U" 5       (       a  [        R                  $ U" 5       (       a  [        R
                  $ [        R                  $ US:X  a,  U" 5       (       a  [        R                  $ [        R                  $ [        R                  $ )Nc                 8   > [        T R                  S5      5      $ )Nzc:ser/c:spPr/a:ln/a:noFill)r+   r   )scatterCharts   r   noLine>PlotTypeInspector._differentiate_xy_chart_type.<locals>.noLine  s    **+GHIIr   c                 h   > TR                  S5      n U (       a  U S   R                  S5      S:X  a  ggr   r   )symbolsr   s    r   r   APlotTypeInspector._differentiate_xy_chart_type.<locals>.noMarkers  s1    "(()BCG71:>>%0F:r   zc:scatterStyler   r/   
lineMarkersmoothMarker)	r   r   r   r   
XY_SCATTERXY_SCATTER_LINES_NO_MARKERSXY_SCATTER_LINESXY_SCATTER_SMOOTH_NO_MARKERSXY_SCATTER_SMOOTH)r   r   r   r   scatter_styler   s        @r   r   .PlotTypeInspector._differentiate_xy_chart_type  s    }}	J	 %**+;<Q?CCEJL(xx}}${{555&&&N*{{666'''}}r   rG   N)r;   r<   r=   r>   r?   classmethodr   r   r   r   r   r   r   r   r   r   rB   rG   r   r   r~   r~      s    
 ' '. & & & & U U    B B
 * *, 8 8
    $  r   r~   N) r?   
__future__r   pptx.chart.categoryr   pptx.chart.datalabelr   pptx.chart.seriesr   pptx.enum.chartr   r   pptx.oxml.nsr   pptx.oxml.simpletypesr	   r
   	pptx.utilr   objectr   rE   rK   rN   r^   rj   rm   rp   rs   rv   r|   r~   rG   r   r   <module>r      s    # * + . /  8 "\@ \@~y  -7i -7`   69 y i 	 Y "._ _r   