
    li                      d Z ddlmZ ddlmZ ddlmZ ddlmZ ddl	m
Z
 ddlmZ d Zd	 Z G d
 de      Z G d de      Z G d de      Z G d de      Z G d de      Z G d de      Z G d de      Z G d de      Z G d de      Z G d de      Z G d de      Z G d  d!e      Z G d" d#e      Z G d$ d%e      Z G d& d'e      Z G d( d)e      Z G d* d+e      Z y,)-z8Composers for default chart XML for various chart types.    )annotations)deepcopyescape)XL_CHART_TYPE)	parse_xml)nsdeclsc                (   t         }	 i |j                  t        |j                  t        |j                  t        |j
                  t        |j                  t        |j                  t        |j                  t        |j                  t        |j                  t        |j                  t        |j                  t        |j                  t         |j"                  t         |j$                  t&        |j(                  t&        |j*                  t&        |j,                  t&        |j.                  t&        |j0                  t&        |j2                  t4        |j6                  t4        |j8                  t:        |j<                  t:        |j>                  t:        |j@                  tB        |jD                  tB        |jF                  tB        |jH                  tB        |jJ                  tB        i|    } || |      S # tL        $ r tO        d| z        w xY w)z
    Factory function returning appropriate XML writer object for
    *chart_type*, loaded with *chart_type* and *chart_data*.
    z0XML writer for chart type %s not yet implemented)(r   AREA_AreaChartXmlWriterAREA_STACKEDAREA_STACKED_100BAR_CLUSTERED_BarChartXmlWriterBAR_STACKEDBAR_STACKED_100BUBBLE_BubbleChartXmlWriterBUBBLE_THREE_D_EFFECTCOLUMN_CLUSTEREDCOLUMN_STACKEDCOLUMN_STACKED_100DOUGHNUT_DoughnutChartXmlWriterDOUGHNUT_EXPLODEDLINE_LineChartXmlWriterLINE_MARKERSLINE_MARKERS_STACKEDLINE_MARKERS_STACKED_100LINE_STACKEDLINE_STACKED_100PIE_PieChartXmlWriterPIE_EXPLODEDRADAR_RadarChartXmlWriterRADAR_FILLEDRADAR_MARKERS
XY_SCATTER_XyChartXmlWriterXY_SCATTER_LINESXY_SCATTER_LINES_NO_MARKERSXY_SCATTER_SMOOTHXY_SCATTER_SMOOTH_NO_MARKERSKeyErrorNotImplementedError)
chart_type
chart_dataXL_CT
BuilderClss       R/var/www/html/eduruby.in/venv/lib/python3.12/site-packages/pptx/chart/xmlwriter.pyChartXmlWriterr7      s   
 E!c
JJ+
 3
 ""$7
 !3	

 1
 !!#5
 LL/
 '')>
 ""$6
   "4
 $$&8
 NN3
 ##%<
 JJ+
  3
  &&(;!
" **,?#
$  3""$7II) 2KK- 4!5/""$5--/@##%6..0A;
< =
B j*--  c!"TWa"abbcs   G(G9 9Hc                *   t         }|j                  t        |j                  t        |j                  t
        |j                  t
        |j                  t
        |j                  t
        |j                  t
        ij                  | t              } ||      S )zQ
    Return a |_BaseSeriesXmlRewriter| subclass appropriate to *chart_type*.
    )r   r   _BubbleSeriesXmlRewriterr   r*   _XySeriesXmlRewriterr,   r-   r.   r/   get_CategorySeriesXmlRewriter)r2   r3   r4   RewriterClss       r6   SeriesXmlRewriterFactoryr>   8   s     E 	.##%=. 4))+?!5**,@ 
c*01  z""    c                  2     e Zd ZdZ fdZed        Z xZS )_BaseChartXmlWriterz
    Generates XML text (unicode) for a default chart, like the one added by
    PowerPoint when you click the *Add Column Chart* button on the ribbon.
    Differentiated XML for different chart types is provided by subclasses.
    c                f    t         t        |           || _        || _        t        |      | _        y N)superrA   __init___chart_type_chart_datalist_series_seq)selfr2   
series_seq	__class__s      r6   rE   z_BaseChartXmlWriter.__init__V   s.    !413%%
+r?   c                    t        d      )z
        The full XML stream for the chart specified by this chart builder, as
        unicode text. This method must be overridden by each subclass.
        z%must be implemented by all subclassesr1   rJ   s    r6   xmlz_BaseChartXmlWriter.xml\   s     ""IJJr?   )__name__
__module____qualname____doc__rE   propertyrP   __classcell__rL   s   @r6   rA   rA   O   s#    , K Kr?   rA   c                  p     e Zd ZdZd	 fd	Zed        Zd Zd Zed        Z	ed        Z
ed        Z xZS )
_BaseSeriesXmlWriterz9
    Provides shared members for series XML writers.
    c                F    t         t        |           || _        || _        y rC   )rD   rY   rE   _series
_date_1904)rJ   series	date_1904rL   s      r6   rE   z_BaseSeriesXmlWriter.__init__j   s    "D24#r?   c                @    t        | j                  j                        S )z7
        The XML-escaped name for this series.
        )r   r[   namerO   s    r6   r`   z_BaseSeriesXmlWriter.nameo   s    
 dll''((r?   c                P    | j                  |      } dj                  di |||dS )zh
        Return the ``<c:numRef>`` element specified by the parameters as
        unicode text.
        z            <c:numRef>
              <c:f>{wksht_ref}</c:f>
              <c:numCache>
                <c:formatCode>{number_format}</c:formatCode>
{pt_xml}              </c:numCache>
            </c:numRef>
)	wksht_refnumber_formatpt_xml )rd   format)rJ   rb   rc   valuesrd   s        r6   
numRef_xmlz_BaseSeriesXmlWriter.numRef_xmlv   sB    
 V$( &_ "+]V\]_ 	_r?   c                    dj                  t        |            }d}t        |      D ]  \  }}|	||j                  ||      z  }  |S )a  
        Return the ``<c:ptCount>`` and sequence of ``<c:pt>`` elements
        corresponding to *values* as a single unicode text string.
        `c:ptCount` refers to the number of `c:pt` elements in this sequence.
        The `idx` attribute value for `c:pt` elements locates the data point
        in the overall data point sequence of the chart and is started at
        *offset*.
        z.                <c:ptCount val="{pt_count}"/>
)pt_countz`                <c:pt idx="{idx}">
                  <c:v>{value}</c:v>
                </c:pt>
)idxvalue)rf   len	enumerate)rJ   rg   rP   pt_tmplrk   rl   s         r6   rd   z_BaseSeriesXmlWriter.pt_xml   si     AHHRUV\R]H^( 	
 $F+ 	8JC}7>>c>77C	8
 
r?   c           
          | j                   j                  di | j                  j                  | j                  dt        d      z  d}t        |      S )zg
        Return a ``<c:tx>`` oxml element for this series, containing the
        series name.
         %scrb   series_namer	   re   )_tx_tmplrf   r[   name_refr`   r	   r   rJ   rP   s     r6   txz_BaseSeriesXmlWriter.tx   sP     #dmm"" 
!\\22#yy 73</
 ~r?   c                ~     | j                   j                  di | j                  j                  | j                  ddS )z
        Return the ``<c:tx>`` (tx is short for 'text') element for this
        series as unicode text. This element contains the series name.
         rs   re   )ru   rf   r[   rv   r`   rO   s    r6   tx_xmlz_BaseSeriesXmlWriter.tx_xml   s>     $t}}## 
!\\22#yy
 	
r?   c                     	 y)z
        The string formatting template for the ``<c:tx>`` element for this
        series, containing the series title and spreadsheet range reference.
        a>            <c:tx{nsdecls}>
            <c:strRef>
              <c:f>{wksht_ref}</c:f>
              <c:strCache>
                <c:ptCount val="1"/>
                <c:pt idx="0">
                  <c:v>{series_name}</c:v>
                </c:pt>
              </c:strCache>
            </c:strRef>
          </c:tx>
re   rO   s    r6   ru   z_BaseSeriesXmlWriter._tx_tmpl   s    
"	
r?   )F)rQ   rR   rS   rT   rE   rU   r`   rh   rd   rx   r{   ru   rV   rW   s   @r6   rY   rY   e   sh    $
 ) )_ .   
 
 
 
r?   rY   c                  @     e Zd ZdZ fdZd Zd Zd Zd Zd Z	 xZ
S )_BaseSeriesXmlRewriterz.
    Base class for series XML rewriters.
    c                8    t         t        |           || _        y rC   )rD   r~   rE   rG   )rJ   r3   rL   s     r6   rE   z_BaseSeriesXmlRewriter.__init__   s    $d46%r?   c                    |j                   |j                  }}| j                  }| j                  |t	        |             t        |j                  |      D ]  \  }}| j                  |||        y)a  
        Rewrite the series data under *chartSpace* using the chart data
        contents. All series-level formatting is left undisturbed. If
        the chart data contains fewer series than *chartSpace*, the extra
        series in *chartSpace* are deleted. If *chart_data* contains more
        series than the *chartSpace* element, new series are added to the
        last plot in the chart and series formatting is "cloned" from the
        last series in that plot.
        N)plotArear^   rG   _adjust_ser_countrm   zipsers_rewrite_ser_data)rJ   
chartSpacer   r^   r3   serseries_datas          r6   replace_series_dataz*_BaseSeriesXmlRewriter.replace_series_data   sk     )11:3G3G)%%
xZ9 #HMM: > 	@C""3Y?	@r?   c                X    fd}j                   }t        |      D ]
  } ||      } y)z
        Add `c:ser` elements to the last xChart element in *plotArea*, cloned
        from the last `c:ser` child of that last xChart.
        c                    t        |       }j                  |j                  _        j                  |j
                  _        | j                  |       |S rC   )r   next_idxrk   val
next_orderorderaddnext)r   new_serr   s     r6   	clone_serz:_BaseSeriesXmlRewriter._add_cloned_sers.<locals>.clone_ser   s@    smG&//GKKO ( 3 3GMMKK Nr?   N)last_serrange)rJ   r   countr   r   _s    `    r6   _add_cloned_sersz'_BaseSeriesXmlRewriter._add_cloned_sers   s2    	 $$u 	+A *H	+r?   c                    |t        |j                        z
  }|dkD  r| j                  ||       y|dk  r| j                  |t	        |             yy)a  
        Adjust the number of c:ser elements in *plotArea* to *new_ser_count*.
        Excess c:ser elements are deleted from the end, along with any xChart
        elements that are left empty as a result. Series elements are
        considered in xChart + series order. Any new c:ser elements required
        are added to the last xChart element and cloned from the last c:ser
        element in that xChart.
        r   N)rm   r   r   _trim_ser_count_byabs)rJ   r   new_ser_countser_count_diffs       r6   r   z(_BaseSeriesXmlRewriter._adjust_ser_count   sQ     'X]]);;A!!(N;a##Hc..AB  r?   c                    t        d      )zh
        Rewrite selected child elements of *ser* based on the values in
        *series_data*.
        z$must be implemented by each subclassrN   )rJ   r   r   r^   s       r6   r   z(_BaseSeriesXmlRewriter._rewrite_ser_data  s    
 ""HIIr?   c                :   |j                   | d }|D ]#  }|j                         }|j                  |       % |j                         D cg c]  }t	        |j                         dk(  s| }}|D ]#  }|j                         }|j                  |       % yc c}w )z
        Remove the last *count* ser elements from *plotArea*. Any xChart
        elements having no ser child elements after trimming are also
        removed.
        Nr   )r   	getparentremoveiter_xChartsrm   )rJ   r   r   
extra_sersr   parentxChartextra_xChartss           r6   r   z)_BaseSeriesXmlRewriter._trim_ser_count_by  s     ]]E67+
 	C]]_FMM#	 /7.C.C.E_FV[[IY]^I^__# 	"F%%'FMM&!	" `s   B)B)rQ   rR   rS   rT   rE   r   r   r   r   r   rV   rW   s   @r6   r~   r~      s)    &@ +"CJ"r?   r~   c                  P    e Zd ZdZed        Zed        Zed        Zed        Zy)r   zS
    Provides specialized methods particular to the ``<c:areaChart>`` element.
    c                j     dj                   di | j                  | j                  | j                  dS )Na  <?xml version='1.0' encoding='UTF-8' standalone='yes'?>
<c:chartSpace xmlns:c="http://schemas.openxmlformats.org/drawingml/2006/chart" xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships">
  <c:date1904 val="0"/>
  <c:roundedCorners val="0"/>
  <c:chart>
    <c:autoTitleDeleted val="0"/>
    <c:plotArea>
      <c:layout/>
      <c:areaChart>
{grouping_xml}        <c:varyColors val="0"/>
{ser_xml}        <c:dLbls>
          <c:showLegendKey val="0"/>
          <c:showVal val="0"/>
          <c:showCatName val="0"/>
          <c:showSerName val="0"/>
          <c:showPercent val="0"/>
          <c:showBubbleSize val="0"/>
        </c:dLbls>
        <c:axId val="-2101159928"/>
        <c:axId val="-2100718248"/>
      </c:areaChart>
{cat_ax_xml}      <c:valAx>
        <c:axId val="-2100718248"/>
        <c:scaling>
          <c:orientation val="minMax"/>
        </c:scaling>
        <c:delete val="0"/>
        <c:axPos val="l"/>
        <c:majorGridlines/>
        <c:numFmt formatCode="General" sourceLinked="1"/>
        <c:majorTickMark val="out"/>
        <c:minorTickMark val="none"/>
        <c:tickLblPos val="nextTo"/>
        <c:crossAx val="-2101159928"/>
        <c:crosses val="autoZero"/>
        <c:crossBetween val="midCat"/>
      </c:valAx>
    </c:plotArea>
    <c:legend>
      <c:legendPos val="r"/>
      <c:layout/>
      <c:overlay val="0"/>
    </c:legend>
    <c:plotVisOnly val="1"/>
    <c:dispBlanksAs val="zero"/>
    <c:showDLblsOverMax val="0"/>
  </c:chart>
  <c:txPr>
    <a:bodyPr/>
    <a:lstStyle/>
    <a:p>
      <a:pPr>
        <a:defRPr sz="1800"/>
      </a:pPr>
      <a:endParaRPr/>
    </a:p>
  </c:txPr>
</c:chartSpace>
grouping_xmlser_xml
cat_ax_xmlre   rf   _grouping_xml_ser_xml_cat_ax_xmlrO   s    r6   rP   z_AreaChartXmlWriter.xml$  sJ    A? @ &CG
F !% 2 2=="..EG
 G	
r?   c                    | j                   j                  }|j                  r dj                  di d|j                  iS 	 y)Na!        <c:dateAx>
        <c:axId val="-2101159928"/>
        <c:scaling>
          <c:orientation val="minMax"/>
        </c:scaling>
        <c:delete val="0"/>
        <c:axPos val="b"/>
        <c:numFmt formatCode="{nf}" sourceLinked="1"/>
        <c:majorTickMark val="out"/>
        <c:minorTickMark val="none"/>
        <c:tickLblPos val="nextTo"/>
        <c:crossAx val="-2100718248"/>
        <c:crosses val="autoZero"/>
        <c:auto val="1"/>
        <c:lblOffset val="100"/>
        <c:baseTimeUnit val="days"/>
      </c:dateAx>
nfa?        <c:catAx>
        <c:axId val="-2101159928"/>
        <c:scaling>
          <c:orientation val="minMax"/>
        </c:scaling>
        <c:delete val="0"/>
        <c:axPos val="b"/>
        <c:numFmt formatCode="General" sourceLinked="1"/>
        <c:majorTickMark val="out"/>
        <c:minorTickMark val="none"/>
        <c:tickLblPos val="nextTo"/>
        <c:crossAx val="-2100718248"/>
        <c:crosses val="autoZero"/>
        <c:auto val="1"/>
        <c:lblAlgn val="ctr"/>
        <c:lblOffset val="100"/>
        <c:noMultiLvlLbl val="0"/>
      </c:catAx>
re   rG   
categories	are_datesrf   rc   rJ   r   s     r6   r   z_AreaChartXmlWriter._cat_ax_xmlo  sV    %%00
&" f%9$ j667%9 9*!	
r?   c                    t         j                  dt         j                  dt         j                  di| j                     }d|z  S )NstandardstackedpercentStackedz        <c:grouping val="%s"/>
)r   r   r   r   rF   )rJ   r   s     r6   r   z!_AreaChartXmlWriter._grouping_xml  sJ     
&&	**,<
 

	
 2C77r?   c                    d}| j                   D ]Z  }t        |      }| dj                  di |j                  |j                  |j                  |j
                  |j                  dz  }\ |S Nrz   z        <c:ser>
          <c:idx val="{ser_idx}"/>
          <c:order val="{ser_order}"/>
{tx_xml}{cat_xml}{val_xml}        </c:ser>
)ser_idx	ser_orderr{   cat_xmlval_xmlre   rG   _CategorySeriesXmlWriterrf   indexr{   r   r   rJ   rP   r]   
xml_writers       r6   r   z_AreaChartXmlWriter._ser_xml      && 	F1&9J % f  &||!'(//)11)11 C	& 
r?   N)	rQ   rR   rS   rT   rU   rP   r   r   r   re   r?   r6   r   r     s[     H
 H
T +
 +
Z 8 8  r?   r   c                      e Zd ZdZed        Zed        Zed        Zed        Zed        Z	ed        Z
ed        Zed	        Zy
)r   zR
    Provides specialized methods particular to the ``<c:barChart>`` element.
    c                     dj                   di | j                  | j                  | j                  | j                  | j
                  | j                  dS )Na  <?xml version='1.0' encoding='UTF-8' standalone='yes'?>
<c:chartSpace xmlns:c="http://schemas.openxmlformats.org/drawingml/2006/chart" xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships">
  <c:date1904 val="0"/>
  <c:chart>
    <c:autoTitleDeleted val="0"/>
    <c:plotArea>
      <c:barChart>
{barDir_xml}{grouping_xml}{ser_xml}{overlap_xml}        <c:axId val="-2068027336"/>
        <c:axId val="-2113994440"/>
      </c:barChart>
{cat_ax_xml}      <c:valAx>
        <c:axId val="-2113994440"/>
        <c:scaling/>
        <c:delete val="0"/>
        <c:axPos val="{val_ax_pos}"/>
        <c:majorGridlines/>
        <c:majorTickMark val="out"/>
        <c:minorTickMark val="none"/>
        <c:tickLblPos val="nextTo"/>
        <c:crossAx val="-2068027336"/>
        <c:crosses val="autoZero"/>
      </c:valAx>
    </c:plotArea>
    <c:dispBlanksAs val="gap"/>
  </c:chart>
  <c:txPr>
    <a:bodyPr/>
    <a:lstStyle/>
    <a:p>
      <a:pPr>
        <a:defRPr sz="1800"/>
      </a:pPr>
      <a:endParaRPr lang="en-US"/>
    </a:p>
  </c:txPr>
</c:chartSpace>
)
barDir_xmlr   r   overlap_xmlr   
val_ax_posre   )rf   _barDir_xmlr   r   _overlap_xmlr   _val_ax_posrO   s    r6   rP   z_BarChartXmlWriter.xml  sa    -+ X &[6
^ #.. $ 2 2==#00".."..]6
 6	
r?   c                   t         }|j                  |j                  |j                  f}|j                  |j
                  |j                  f}| j                  |v ry| j                  |v ryt        d| j                  z        )Nz        <c:barDir val="bar"/>
z        <c:barDir val="col"/>
z"no _barDir_xml() for chart type %s)	r   r   r   r   r   r   r   rF   r1   )rJ   XL	bar_types	col_typess       r6   r   z_BarChartXmlWriter._barDir_xml  sz    %%r~~r7I7IJ	(("*;*;R=R=RS	y(4*4!"FIYIY"YZZr?   c                    t         j                  dt         j                  dt         j                  dt         j                  dt         j
                  dt         j                  di| j                     S )Nlbr   r   r   r   r   r   r   rF   rO   s    r6   _cat_ax_posz_BarChartXmlWriter._cat_ax_pos	  `     ''%%s))3**C((#,,c
 

 	r?   c                    | j                   j                  }|j                  r) dj                  di | j                  |j
                  dS  dj                  di d| j                  iS )Na,        <c:dateAx>
        <c:axId val="-2068027336"/>
        <c:scaling>
          <c:orientation val="minMax"/>
        </c:scaling>
        <c:delete val="0"/>
        <c:axPos val="{cat_ax_pos}"/>
        <c:numFmt formatCode="{nf}" sourceLinked="1"/>
        <c:majorTickMark val="out"/>
        <c:minorTickMark val="none"/>
        <c:tickLblPos val="nextTo"/>
        <c:crossAx val="-2113994440"/>
        <c:crosses val="autoZero"/>
        <c:auto val="1"/>
        <c:lblOffset val="100"/>
        <c:baseTimeUnit val="days"/>
      </c:dateAx>
)
cat_ax_posr   a        <c:catAx>
        <c:axId val="-2068027336"/>
        <c:scaling>
          <c:orientation val="minMax"/>
        </c:scaling>
        <c:delete val="0"/>
        <c:axPos val="{cat_ax_pos}"/>
        <c:majorTickMark val="out"/>
        <c:minorTickMark val="none"/>
        <c:tickLblPos val="nextTo"/>
        <c:crossAx val="-2113994440"/>
        <c:crosses val="autoZero"/>
        <c:auto val="1"/>
        <c:lblAlgn val="ctr"/>
        <c:lblOffset val="100"/>
        <c:noMultiLvlLbl val="0"/>
      </c:catAx>
r   re   )rG   r   r   rf   r   rc   r   s     r6   r   z_BarChartXmlWriter._cat_ax_xml  s    %%00
&" f%Y$ '+&6&6j>V>VW%Y Y(!" &%5$ !$"2"23%5 	5r?   c                (   t         }|j                  |j                  f}|j                  |j                  f}|j
                  |j                  f}| j                  |v ry| j                  |v ry| j                  |v ryt        d| j                  z        )Nz&        <c:grouping val="clustered"/>
$        <c:grouping val="stacked"/>
+        <c:grouping val="percentStacked"/>
$no _grouping_xml() for chart type %s)	r   r   r   r   r   r   r   rF   r1   )rJ   r   clustered_typesstacked_typespercentStacked_typess        r6   r   z _BarChartXmlWriter._grouping_xmlA  s    ++R-@-@A):):; " 2 2B4I4IJ.<.:!55A!"H4K[K["[\\r?   c                    t         }|j                  |j                  |j                  |j                  f}| j
                  |v ryy)Nz        <c:overlap val="100"/>
rz   )r   r   r   r   r   rF   )rJ   r   r   s      r6   r   z_BarChartXmlWriter._overlap_xmlO  sH    NN!!	 
 335r?   c                    d}| j                   D ]Z  }t        |      }| dj                  di |j                  |j                  |j                  |j
                  |j                  dz  }\ |S r   r   r   s       r6   r   z_BarChartXmlWriter._ser_xml\  r   r?   c                    t         j                  dt         j                  dt         j                  dt         j                  dt         j
                  dt         j                  di| j                     S )Nr   r   r   rO   s    r6   r   z_BarChartXmlWriter._val_ax_post  r   r?   N)rQ   rR   rS   rT   rU   rP   r   r   r   r   r   r   r   re   r?   r6   r   r     s     7
 7
r [ [   *5 *5X ] ] 
 
  .  r?   r   c                  @    e Zd ZdZed        Zed        Zed        Zy)r   z[
    Provides specialized methods particular to the ``<c:doughnutChart>``
    element.
    c                >     dj                   di d| j                  iS )Na  <?xml version='1.0' encoding='UTF-8' standalone='yes'?>
<c:chartSpace xmlns:c="http://schemas.openxmlformats.org/drawingml/2006/chart" xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships">
  <c:date1904 val="0"/>
  <c:roundedCorners val="0"/>
  <c:chart>
    <c:autoTitleDeleted val="0"/>
    <c:plotArea>
      <c:layout/>
      <c:doughnutChart>
        <c:varyColors val="1"/>
{ser_xml}        <c:dLbls>
          <c:showLegendKey val="0"/>
          <c:showVal val="0"/>
          <c:showCatName val="0"/>
          <c:showSerName val="0"/>
          <c:showPercent val="0"/>
          <c:showBubbleSize val="0"/>
          <c:showLeaderLines val="1"/>
        </c:dLbls>
        <c:firstSliceAng val="0"/>
        <c:holeSize val="50"/>
      </c:doughnutChart>
    </c:plotArea>
    <c:legend>
      <c:legendPos val="r"/>
      <c:layout/>
      <c:overlay val="0"/>
    </c:legend>
    <c:plotVisOnly val="1"/>
    <c:dispBlanksAs val="gap"/>
    <c:showDLblsOverMax val="0"/>
  </c:chart>
  <c:txPr>
    <a:bodyPr/>
    <a:lstStyle/>
    <a:p>
      <a:pPr>
        <a:defRPr sz="1800"/>
      </a:pPr>
      <a:endParaRPr/>
    </a:p>
  </c:txPr>
</c:chartSpace>
r   re   rf   r   rO   s    r6   rP   z_DoughnutChartXmlWriter.xml  s4    0. ^ &a0/` t}}-a0/ 0	/r?   c                @    | j                   t        j                  k(  ryyNz"          <c:explosion val="25"/>
rz   )rF   r   r   rO   s    r6   _explosion_xmlz&_DoughnutChartXmlWriter._explosion_xml  s    }>>>8r?   c                    d}| j                   D ]e  }t        |      }| dj                  di |j                  |j                  |j                  | j
                  |j                  |j                  dz  }g |S )Nrz   z        <c:ser>
          <c:idx val="{ser_idx}"/>
          <c:order val="{ser_order}"/>
{tx_xml}{explosion_xml}{cat_xml}{val_xml}        </c:ser>
)r   r   r{   explosion_xmlr   r   re   )rG   r   rf   r   r{   r   r   r   r   s       r6   r   z _DoughnutChartXmlWriter._ser_xml  s    && 	F1&9J 	% f  &||!'(//%)%8%8)11)11 C	* 
r?   NrQ   rR   rS   rT   rU   rP   r   r   re   r?   r6   r   r     sD    
 1/ 1/f  
  r?   r   c                  `    e Zd ZdZed        Zed        Zed        Zed        Zed        Z	y)r   zS
    Provides specialized methods particular to the ``<c:lineChart>`` element.
    c                j     dj                   di | j                  | j                  | j                  dS )Na`  <?xml version='1.0' encoding='UTF-8' standalone='yes'?>
<c:chartSpace xmlns:c="http://schemas.openxmlformats.org/drawingml/2006/chart" xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships">
  <c:date1904 val="0"/>
  <c:chart>
    <c:autoTitleDeleted val="0"/>
    <c:plotArea>
      <c:lineChart>
{grouping_xml}        <c:varyColors val="0"/>
{ser_xml}        <c:marker val="1"/>
        <c:smooth val="0"/>
        <c:axId val="2118791784"/>
        <c:axId val="2140495176"/>
      </c:lineChart>
{cat_ax_xml}      <c:valAx>
        <c:axId val="2140495176"/>
        <c:scaling/>
        <c:delete val="0"/>
        <c:axPos val="l"/>
        <c:majorGridlines/>
        <c:majorTickMark val="out"/>
        <c:minorTickMark val="none"/>
        <c:tickLblPos val="nextTo"/>
        <c:crossAx val="2118791784"/>
        <c:crosses val="autoZero"/>
      </c:valAx>
    </c:plotArea>
    <c:legend>
      <c:legendPos val="r"/>
      <c:layout/>
      <c:overlay val="0"/>
    </c:legend>
    <c:plotVisOnly val="1"/>
    <c:dispBlanksAs val="gap"/>
    <c:showDLblsOverMax val="0"/>
  </c:chart>
  <c:txPr>
    <a:bodyPr/>
    <a:lstStyle/>
    <a:p>
      <a:pPr>
        <a:defRPr sz="1800"/>
      </a:pPr>
      <a:endParaRPr lang="en-US"/>
    </a:p>
  </c:txPr>
</c:chartSpace>
r   re   r   rO   s    r6   rP   z_LineChartXmlWriter.xml  sF    53 h &k;
n !% 2 2=="..m;
 ;	
r?   c                    | j                   j                  }|j                  r dj                  di d|j                  iS 	 y)Na        <c:dateAx>
        <c:axId val="2118791784"/>
        <c:scaling>
          <c:orientation val="minMax"/>
        </c:scaling>
        <c:delete val="0"/>
        <c:axPos val="b"/>
        <c:numFmt formatCode="{nf}" sourceLinked="1"/>
        <c:majorTickMark val="out"/>
        <c:minorTickMark val="none"/>
        <c:tickLblPos val="nextTo"/>
        <c:crossAx val="2140495176"/>
        <c:crosses val="autoZero"/>
        <c:auto val="1"/>
        <c:lblOffset val="100"/>
        <c:baseTimeUnit val="days"/>
      </c:dateAx>
r   a        <c:catAx>
        <c:axId val="2118791784"/>
        <c:scaling>
          <c:orientation val="minMax"/>
        </c:scaling>
        <c:delete val="0"/>
        <c:axPos val="b"/>
        <c:majorTickMark val="out"/>
        <c:minorTickMark val="none"/>
        <c:tickLblPos val="nextTo"/>
        <c:crossAx val="2140495176"/>
        <c:crosses val="autoZero"/>
        <c:auto val="1"/>
        <c:lblAlgn val="ctr"/>
        <c:lblOffset val="100"/>
        <c:noMultiLvlLbl val="0"/>
      </c:catAx>
re   r   r   s     r6   r   z_LineChartXmlWriter._cat_ax_xml  sV    %%00
&" f%9$ j667%9 9*!	
r?   c                (   t         }|j                  |j                  f}|j                  |j                  f}|j
                  |j                  f}| j                  |v ry| j                  |v ry| j                  |v ryt        d| j                  z        )Nz%        <c:grouping val="standard"/>
r   r   r   )	r   r   r   r!   r   r"   r    rF   r1   )rJ   r   standard_typesr   r   s        r6   r   z!_LineChartXmlWriter._grouping_xmlL  s    ''2??3"*A*AB " 3 3R5P5PQ~-;.:!55A!"H4K[K["[\\r?   c                v    t         }|j                  |j                  |j                  f}| j                  |v r	 yyNzN          <c:marker>
            <c:symbol val="none"/>
          </c:marker>
rz   )r   r   r!   r"   rF   )rJ   r   no_marker_typess      r6   _marker_xmlz_LineChartXmlWriter._marker_xmlZ  s>    77BOOR5H5HI.*
 r?   c                    d}| j                   D ]e  }t        |      }| dj                  di |j                  |j                  |j                  | j
                  |j                  |j                  dz  }g |S Nrz   z        <c:ser>
          <c:idx val="{ser_idx}"/>
          <c:order val="{ser_order}"/>
{tx_xml}{marker_xml}{cat_xml}{val_xml}          <c:smooth val="0"/>
        </c:ser>
)r   r   r{   
marker_xmlr   r   re   rG   r   rf   r   r{   r   r   r   r   s       r6   r   z_LineChartXmlWriter._ser_xmlf      && 	F1&9J 
% f  &||!'(//"&"2"2)11)11 C	, 
r?   N)
rQ   rR   rS   rT   rU   rP   r   r   r   r   re   r?   r6   r   r     so     <
 <
| *
 *
X ] ] 	 	  r?   r   c                  @    e Zd ZdZed        Zed        Zed        Zy)r$   zR
    Provides specialized methods particular to the ``<c:pieChart>`` element.
    c                >     dj                   di d| j                  iS )Na  <?xml version='1.0' encoding='UTF-8' standalone='yes'?>
<c:chartSpace xmlns:c="http://schemas.openxmlformats.org/drawingml/2006/chart" xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships">
  <c:chart>
    <c:autoTitleDeleted val="0"/>
    <c:plotArea>
      <c:pieChart>
        <c:varyColors val="1"/>
{ser_xml}      </c:pieChart>
    </c:plotArea>
    <c:dispBlanksAs val="gap"/>
  </c:chart>
  <c:txPr>
    <a:bodyPr/>
    <a:lstStyle/>
    <a:p>
      <a:pPr>
        <a:defRPr sz="1800"/>
      </a:pPr>
      <a:endParaRPr lang="en-US"/>
    </a:p>
  </c:txPr>
</c:chartSpace>
r   re   r   rO   s    r6   rP   z_PieChartXmlWriter.xml  s0     4 &7/6 t}}-7/ 	/r?   c                @    | j                   t        j                  k(  ryyr   )rF   r   r%   rO   s    r6   r   z!_PieChartXmlWriter._explosion_xml  s    }9998r?   c           	         t        | j                  d         } dj                  di |j                  | j                  |j
                  |j                  d}|S )Nr   z        <c:ser>
          <c:idx val="0"/>
          <c:order val="0"/>
{tx_xml}{explosion_xml}{cat_xml}{val_xml}        </c:ser>
)r{   r   r   r   re   )r   rG   rf   r{   r   r   r   )rJ   r   rP   s      r6   r   z_PieChartXmlWriter._ser_xml  sf    -d.>.>q.AB
	! &
 %++!%!4!4%--%--	
" 
r?   Nr   re   r?   r6   r$   r$     sC     / /<  
  r?   r$   c                  P    e Zd ZdZed        Zed        Zed        Zed        Zy)r'   z;
    Generates XML for the ``<c:radarChart>`` element.
    c                T     dj                   di | j                  | j                  dS )NaI	  <?xml version='1.0' encoding='UTF-8' standalone='yes'?>
<c:chartSpace xmlns:c="http://schemas.openxmlformats.org/drawingml/2006/chart" xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships">
  <c:date1904 val="0"/>
  <c:roundedCorners val="0"/>
  <mc:AlternateContent xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006">
    <mc:Choice xmlns:c14="http://schemas.microsoft.com/office/drawing/2007/8/2/chart" Requires="c14">
      <c14:style val="118"/>
    </mc:Choice>
    <mc:Fallback>
      <c:style val="18"/>
    </mc:Fallback>
  </mc:AlternateContent>
  <c:chart>
    <c:autoTitleDeleted val="0"/>
    <c:plotArea>
      <c:layout/>
      <c:radarChart>
        <c:radarStyle val="{radar_style}"/>
        <c:varyColors val="0"/>
{ser_xml}        <c:axId val="2073612648"/>
        <c:axId val="-2112772216"/>
      </c:radarChart>
      <c:catAx>
        <c:axId val="2073612648"/>
        <c:scaling>
          <c:orientation val="minMax"/>
        </c:scaling>
        <c:delete val="0"/>
        <c:axPos val="b"/>
        <c:majorGridlines/>
        <c:numFmt formatCode="m/d/yy" sourceLinked="1"/>
        <c:majorTickMark val="out"/>
        <c:minorTickMark val="none"/>
        <c:tickLblPos val="nextTo"/>
        <c:crossAx val="-2112772216"/>
        <c:crosses val="autoZero"/>
        <c:auto val="1"/>
        <c:lblAlgn val="ctr"/>
        <c:lblOffset val="100"/>
        <c:noMultiLvlLbl val="0"/>
      </c:catAx>
      <c:valAx>
        <c:axId val="-2112772216"/>
        <c:scaling>
          <c:orientation val="minMax"/>
        </c:scaling>
        <c:delete val="0"/>
        <c:axPos val="l"/>
        <c:majorGridlines/>
        <c:numFmt formatCode="General" sourceLinked="1"/>
        <c:majorTickMark val="cross"/>
        <c:minorTickMark val="none"/>
        <c:tickLblPos val="nextTo"/>
        <c:crossAx val="2073612648"/>
        <c:crosses val="autoZero"/>
        <c:crossBetween val="between"/>
      </c:valAx>
    </c:plotArea>
    <c:plotVisOnly val="1"/>
    <c:dispBlanksAs val="gap"/>
    <c:showDLblsOverMax val="0"/>
  </c:chart>
  <c:txPr>
    <a:bodyPr/>
    <a:lstStyle/>
    <a:p>
      <a:pPr>
        <a:defRPr sz="1800"/>
      </a:pPr>
      <a:endParaRPr lang="en-US"/>
    </a:p>
  </c:txPr>
</c:chartSpace>
)radar_styler   re   )rf   _radar_styler   rO   s    r6   rP   z_RadarChartXmlWriter.xml  sB    PN ^ &aPQ` $(#4#4OaPQ P	Qr?   c                B    | j                   t        j                  k(  r	 yyr   )rF   r   r&   rO   s    r6   r   z _RadarChartXmlWriter._marker_xml  s%    }222*
 r?   c                @    | j                   t        j                  k(  ryy)Nfilledmarker)rF   r   r(   rO   s    r6   r  z!_RadarChartXmlWriter._radar_style&  s    }999r?   c                    d}| j                   D ]e  }t        |      }| dj                  di |j                  |j                  |j                  | j
                  |j                  |j                  dz  }g |S r   r   r   s       r6   r   z_RadarChartXmlWriter._ser_xml,  r   r?   N)	rQ   rR   rS   rT   rU   rP   r   r  r   re   r?   r6   r'   r'     s\     QQ QQf    
  r?   r'   c                  `    e Zd ZdZed        Zed        Zed        Zed        Zed        Z	y)r+   z=
    Generates XML for the ``<c:scatterChart>`` element.
    c                @    d| j                   d| j                  d}|S )Nag  <?xml version='1.0' encoding='UTF-8' standalone='yes'?>
<c:chartSpace xmlns:c="http://schemas.openxmlformats.org/drawingml/2006/chart" xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships">
  <c:chart>
    <c:plotArea>
      <c:scatterChart>
        <c:scatterStyle val="z$"/>
        <c:varyColors val="0"/>
a          <c:axId val="-2128940872"/>
        <c:axId val="-2129643912"/>
      </c:scatterChart>
      <c:valAx>
        <c:axId val="-2128940872"/>
        <c:scaling>
          <c:orientation val="minMax"/>
        </c:scaling>
        <c:delete val="0"/>
        <c:axPos val="b"/>
        <c:numFmt formatCode="General" sourceLinked="1"/>
        <c:majorTickMark val="out"/>
        <c:minorTickMark val="none"/>
        <c:tickLblPos val="nextTo"/>
        <c:crossAx val="-2129643912"/>
        <c:crosses val="autoZero"/>
        <c:crossBetween val="midCat"/>
      </c:valAx>
      <c:valAx>
        <c:axId val="-2129643912"/>
        <c:scaling>
          <c:orientation val="minMax"/>
        </c:scaling>
        <c:delete val="0"/>
        <c:axPos val="l"/>
        <c:majorGridlines/>
        <c:numFmt formatCode="General" sourceLinked="1"/>
        <c:majorTickMark val="out"/>
        <c:minorTickMark val="none"/>
        <c:tickLblPos val="nextTo"/>
        <c:crossAx val="-2128940872"/>
        <c:crosses val="autoZero"/>
        <c:crossBetween val="midCat"/>
      </c:valAx>
    </c:plotArea>
    <c:legend>
      <c:legendPos val="r"/>
      <c:layout/>
      <c:overlay val="0"/>
    </c:legend>
    <c:plotVisOnly val="1"/>
    <c:dispBlanksAs val="gap"/>
    <c:showDLblsOverMax val="0"/>
  </c:chart>
  <c:txPr>
    <a:bodyPr/>
    <a:lstStyle/>
    <a:p>
      <a:pPr>
        <a:defRPr sz="1800"/>
      </a:pPr>
      <a:endParaRPr lang="en-US"/>
    </a:p>
  </c:txPr>
</c:chartSpace>
)_scatterStyle_valr   rw   s     r6   rP   z_XyChartXmlWriter.xmlM  s%    J ##T]]GC4H 
r?   c                d    t         j                  t         j                  f}| j                  |v r	 yyr   )r   r-   r/   rF   )rJ   r   s     r6   r   z_XyChartXmlWriter._marker_xml  s<     5566
 .*
 r?   c                b    t         j                  t         j                  f}| j                  |v ryy)NsmoothMarker
lineMarker)r   r.   r/   rF   )rJ   smooth_typess     r6   r
  z#_XyChartXmlWriter._scatterStyle_val  s3     ++66
 |+!r?   c                   d}| j                   D ]p  }t        |      }| dj                  di |j                  |j                  |j                  | j
                  | j                  |j                  |j                  dz  }r |S )Nrz   z        <c:ser>
          <c:idx val="{ser_idx}"/>
          <c:order val="{ser_order}"/>
{tx_xml}{spPr_xml}{marker_xml}{xVal_xml}{yVal_xml}          <c:smooth val="0"/>
        </c:ser>
)r   r   r{   spPr_xmlr   xVal_xmlyVal_xmlre   )	rG   _XySeriesXmlWriterrf   r   r{   	_spPr_xmlr   r  r  r   s       r6   r   z_XyChartXmlWriter._ser_xml  s    && 	F+F3J 	% f  &||!'(// $"&"2"2 * 3 3 * 3 3 C	0 
r?   c                B    | j                   t        j                  k(  r	 yy)Nzr          <c:spPr>
            <a:ln w="47625">
              <a:noFill/>
            </a:ln>
          </c:spPr>
rz   )rF   r   r*   rO   s    r6   r  z_XyChartXmlWriter._spPr_xml  s%    }777( r?   N)
rQ   rR   rS   rT   rU   rP   r   r
  r   r  re   r?   r6   r+   r+   H  sn     E EN      8 	 	r?   r+   c                  @    e Zd ZdZed        Zed        Zed        Zy)r   zY
    Provides specialized methods particular to the ``<c:bubbleChart>``
    element.
    c                $    d| j                   z  }|S )Na  <?xml version='1.0' encoding='UTF-8' standalone='yes'?>
<c:chartSpace xmlns:c="http://schemas.openxmlformats.org/drawingml/2006/chart" xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships">
  <c:chart>
    <c:autoTitleDeleted val="0"/>
    <c:plotArea>
      <c:layout/>
      <c:bubbleChart>
        <c:varyColors val="0"/>
%s        <c:dLbls>
          <c:showLegendKey val="0"/>
          <c:showVal val="0"/>
          <c:showCatName val="0"/>
          <c:showSerName val="0"/>
          <c:showPercent val="0"/>
          <c:showBubbleSize val="0"/>
        </c:dLbls>
        <c:bubbleScale val="100"/>
        <c:showNegBubbles val="0"/>
        <c:axId val="-2115720072"/>
        <c:axId val="-2115723560"/>
      </c:bubbleChart>
      <c:valAx>
        <c:axId val="-2115720072"/>
        <c:scaling>
          <c:orientation val="minMax"/>
        </c:scaling>
        <c:delete val="0"/>
        <c:axPos val="b"/>
        <c:numFmt formatCode="General" sourceLinked="1"/>
        <c:majorTickMark val="out"/>
        <c:minorTickMark val="none"/>
        <c:tickLblPos val="nextTo"/>
        <c:crossAx val="-2115723560"/>
        <c:crosses val="autoZero"/>
        <c:crossBetween val="midCat"/>
      </c:valAx>
      <c:valAx>
        <c:axId val="-2115723560"/>
        <c:scaling>
          <c:orientation val="minMax"/>
        </c:scaling>
        <c:delete val="0"/>
        <c:axPos val="l"/>
        <c:majorGridlines/>
        <c:numFmt formatCode="General" sourceLinked="1"/>
        <c:majorTickMark val="out"/>
        <c:minorTickMark val="none"/>
        <c:tickLblPos val="nextTo"/>
        <c:crossAx val="-2115720072"/>
        <c:crosses val="autoZero"/>
        <c:crossBetween val="midCat"/>
      </c:valAx>
    </c:plotArea>
    <c:legend>
      <c:legendPos val="r"/>
      <c:layout/>
      <c:overlay val="0"/>
    </c:legend>
    <c:plotVisOnly val="1"/>
    <c:dispBlanksAs val="gap"/>
    <c:showDLblsOverMax val="0"/>
  </c:chart>
  <c:txPr>
    <a:bodyPr/>
    <a:lstStyle/>
    <a:p>
      <a:pPr>
        <a:defRPr sz="1800"/>
      </a:pPr>
      <a:endParaRPr lang="en-US"/>
    </a:p>
  </c:txPr>
</c:chartSpace>
)r   rw   s     r6   rP   z_BubbleChartXmlWriter.xml  s#    L Z MM]N^ 
r?   c                @    | j                   t        j                  k(  ryy)N10)rF   r   r   rO   s    r6   _bubble3D_valz#_BubbleChartXmlWriter._bubble3D_val0  s    }BBBr?   c                   d}| j                   D ]p  }t        |      }| dj                  di |j                  |j                  |j                  |j
                  |j                  |j                  | j                  dz  }r |S )Nrz   z        <c:ser>
          <c:idx val="{ser_idx}"/>
          <c:order val="{ser_order}"/>
{tx_xml}          <c:invertIfNegative val="0"/>
{xVal_xml}{yVal_xml}{bubbleSize_xml}          <c:bubble3D val="{bubble3D_val}"/>
        </c:ser>
)r   r   r{   r  r  bubbleSize_xmlbubble3D_valre   )	rG   _BubbleSeriesXmlWriterrf   r   r{   r  r  r  r  r   s       r6   r   z_BubbleChartXmlWriter._ser_xml6  s    && 	F/7J 	% f  &||!'(// * 3 3 * 3 3&0&?&?$($6$6 C	0 
r?   N)rQ   rR   rS   rT   rU   rP   r  r   re   r?   r6   r   r     sF    
 P Pd  
  r?   r   c                      e Zd ZdZed        Zed        Zed        Zed        Zed        Z	ed        Z
ed        Zd	 Zed
        Zed        Zed        Zed        Zy)r   zG
    Generates XML snippets particular to a category chart series.
    c                   | j                   j                  }|j                  rit         | j                  j
                  di | j                   j                  |j                  |j                  | j                  dt        d      z  d      S |j                  dk(  r^t         | j                  j
                  di | j                   j                  |j                  | j                  dt        d      z  d      S t         | j                  j
                  di | j                   j                  |j                  | j                  |      dt        d      z  d      S )za
        Return the ``<c:cat>`` element XML for this series, as an oxml
        element.
        rq   rr   rb   rc   	cat_count
cat_pt_xmlr	      rb   r$  r%  r	   rb   r$  lvl_xmlr	   re   )r[   r   are_numericr   _numRef_cat_tmplrf   categories_refrc   
leaf_count_cat_num_pt_xmlr	   depth	_cat_tmpl_cat_pt_xml_multiLvl_cat_tmpl_lvl_xmlr   s     r6   catz_CategorySeriesXmlWriter.catY  s@    \\,,
!!,%%,, %)\\%@%@)3)A)A%/%:%:&*&:&:#(73<#7
 
 q %%% %)\\%@%@%/%:%:&*&6&6#(73<#7		 	 *D##** !%!<!<!+!6!6#}}Z8$ws|3		
 		
r?   c           
     :   | j                   j                  }|j                  rT | j                  j                  di | j                   j
                  |j                  |j                  | j                  ddS |j                  dk(  rI | j                  j                  di | j                   j
                  |j                  | j                  ddS  | j                  j                  di | j                   j
                  |j                  | j                  |      ddS )z
        The unicode XML snippet for the ``<c:cat>`` element for this series,
        containing the category labels and spreadsheet reference.
        rz   r#  r&  r'  r(  re   )r[   r   r*  r+  rf   r,  rc   r-  r.  r/  r0  r1  r2  r3  r   s     r6   r   z _CategorySeriesXmlWriter.cat_xml  s    \\,,
!!/4((// !%!<!<%/%=%=!+!6!6"&"6"6!  q (4>>(( !%!<!<!+!6!6"&"2"2!	  .t&&-- 
!\\88'22==4	
 	
r?   c           
          | j                   j                  di dt        d      z  | j                  j                  | j                  j
                  t        | j                        | j                  d}t        |      S )zJ
        The ``<c:val>`` XML for this series, as an oxml element.
        rq   rr   r	   
values_refrc   	val_count
val_pt_xmlre   )		_val_tmplrf   r	   r[   r8  rc   rm   _val_pt_xmlr   rw   s     r6   r   z_CategorySeriesXmlWriter.val  sk    
 $dnn## 
 73</"ll55!%!;!; ."..
 ~r?   c           
          | j                   j                  di d| j                  j                  | j                  j                  t        | j                        | j                  dS )z
        Return the unicode XML snippet for the ``<c:val>`` element describing
        this series, containing the series values and their spreadsheet range
        reference.
        rz   r7  re   )r;  rf   r[   r8  rc   rm   r<  rO   s    r6   r   z _CategorySeriesXmlWriter.val_xml  sY     %t~~$$ 
"ll55!%!;!; ."..
 	
r?   c           
         d}t        | j                  j                        D ]6  \  }}| dj                  di ||j	                  | j
                        dz  }8 |S )z
        The unicode XML snippet for the ``<c:pt>`` elements when category
        labels are numeric (including date type).
        rz   zj                <c:pt idx="{cat_idx}">
                  <c:v>{cat_lbl_str}</c:v>
                </c:pt>
)cat_idxcat_lbl_strre   )rn   r[   r   rf   numeric_str_valr\   rJ   rP   rk   categorys       r6   r.  z(_CategorySeriesXmlWriter._cat_num_pt_xml  ss     &t||'>'>? 
	MC , f		  ##+#;#;DOO#L	 	C
	 
r?   c                    d}t        | j                  j                        D ]9  \  }}| dj                  di |t	        t        |j                              dz  }; |S )z|
        The unicode XML snippet for the ``<c:pt>`` elements containing the
        category names for this series.
        rz   zh                <c:pt idx="{cat_idx}">
                  <c:v>{cat_label}</c:v>
                </c:pt>
)r?  	cat_labelre   )rn   r[   r   rf   r   strlabelrB  s       r6   r1  z$_CategorySeriesXmlWriter._cat_pt_xml  st     &t||'>'>? 	SMC , f	S $'VC<O5PQ	S SC	S 
r?   c                     	 y)z
        The template for the ``<c:cat>`` element for this series, containing
        the category labels and spreadsheet reference.
        z          <c:cat{nsdecls}>
            <c:strRef>
              <c:f>{wksht_ref}</c:f>
              <c:strCache>
                <c:ptCount val="{cat_count}"/>
{cat_pt_xml}              </c:strCache>
            </c:strRef>
          </c:cat>
re   rO   s    r6   r0  z"_CategorySeriesXmlWriter._cat_tmpl      #
	
r?   c           
     l    d }d}|j                   D ]  }| dj                  di d ||      iz  }! |S )zu
        The unicode XML snippet for the ``<c:lvl>`` elements containing
        multi-level category names.
        c                J    d}| D ]  \  }}|d|t        d|z        fz  z  } |S )Nrz   z^                  <c:pt idx="%d">
                    <c:v>%s</c:v>
                  </c:pt>
z%sr   )levelrP   rk   r`   s       r6   
lvl_pt_xmlz5_CategorySeriesXmlWriter._lvl_xml.<locals>.lvl_pt_xml  sH    C" /	T2 &-.	/ // Jr?   rz   z=                <c:lvl>
{lvl_pt_xml}                </c:lvl>
rM  re   )levelsrf   )rJ   r   rM  rP   rL  s        r6   r3  z!_CategorySeriesXmlWriter._lvl_xml  sW    	 && 	Ec[cc E!23 C	 
r?   c                     	 y)z
        The template for the ``<c:cat>`` element for this series when there
        are multi-level (nested) categories.
        a            <c:cat{nsdecls}>
            <c:multiLvlStrRef>
              <c:f>{wksht_ref}</c:f>
              <c:multiLvlStrCache>
                <c:ptCount val="{cat_count}"/>
{lvl_xml}              </c:multiLvlStrCache>
            </c:multiLvlStrRef>
          </c:cat>
re   rO   s    r6   r2  z+_CategorySeriesXmlWriter._multiLvl_cat_tmpl  rI  r?   c                     	 y)z
        The template for the ``<c:cat>`` element for this series when the
        labels are numeric (or date) values.
        a1            <c:cat{nsdecls}>
            <c:numRef>
              <c:f>{wksht_ref}</c:f>
              <c:numCache>
                <c:formatCode>{number_format}</c:formatCode>
                <c:ptCount val="{cat_count}"/>
{cat_pt_xml}              </c:numCache>
            </c:numRef>
          </c:cat>
re   rO   s    r6   r+  z)_CategorySeriesXmlWriter._numRef_cat_tmpl*      	#	
r?   c           	         d}t        | j                  j                        D ]   \  }}|	| dj                  di ||dz  }" |S )z{
        The unicode XML snippet containing the ``<c:pt>`` elements containing
        the values for this series.
        rz   zf                <c:pt idx="{val_idx:d}">
                  <c:v>{value}</c:v>
                </c:pt>
)val_idxrl   re   )rn   r[   rg   rf   )rJ   rP   rk   rl   s       r6   r<  z$_CategorySeriesXmlWriter._val_pt_xml=  si     #DLL$7$78 	9JC} , f	9 $'7	9 9C	9 
r?   c                     	 y)z
        The template for the ``<c:val>`` element for this series, containing
        the series values and their spreadsheet range reference.
        a2            <c:val{nsdecls}>
            <c:numRef>
              <c:f>{values_ref}</c:f>
              <c:numCache>
                <c:formatCode>{number_format}</c:formatCode>
                <c:ptCount val="{val_count}"/>
{val_pt_xml}              </c:numCache>
            </c:numRef>
          </c:val>
re   rO   s    r6   r;  z"_CategorySeriesXmlWriter._val_tmplN  rQ  r?   N)rQ   rR   rS   rT   rU   r4  r   r   r   r.  r1  r0  r3  r2  r+  r<  r;  re   r?   r6   r   r   T  s     )
 )
V #
 #
J   
 
   &   
 
". 
 
" 
 
$    
 
r?   r   c                  p    e Zd ZdZed        Zed        Zed        Zed        Zed        Z	ed        Z
y)	r  z<
    Generates XML snippets particular to an XY series.
    c           
         | j                   j                  di dt        d      z  | j                  | j                  j
                  | j                  j                  | j                  j                        d}t        |      S )z
        Return the ``<c:xVal>`` element for this series as an oxml element.
        This element contains the X values for this series.
        rq   rr   r	   rh   re   )	
_xVal_tmplrf   r	   rh   r[   x_values_refrc   x_valuesr   rw   s     r6   xValz_XySeriesXmlWriter.xValg  o     %doo$$ 	
 73</"ooLL--LL..LL))	
 ~r?   c           
          | j                   j                  di d| j                  | j                  j                  | j                  j
                  | j                  j                        dS )z
        Return the ``<c:xVal>`` element for this series as unicode text. This
        element contains the X values for this series.
        rz   rW  re   )rX  rf   rh   r[   rY  rc   rZ  rO   s    r6   r  z_XySeriesXmlWriter.xVal_xmly  ]     &t%% 	
"ooLL--LL..LL))	
 		
r?   c           
         | j                   j                  di dt        d      z  | j                  | j                  j
                  | j                  j                  | j                  j                        d}t        |      S )z
        Return the ``<c:yVal>`` element for this series as an oxml element.
        This element contains the Y values for this series.
        rq   rr   rW  re   )	
_yVal_tmplrf   r	   rh   r[   y_values_refrc   y_valuesr   rw   s     r6   yValz_XySeriesXmlWriter.yVal  r\  r?   c           
          | j                   j                  di d| j                  | j                  j                  | j                  j
                  | j                  j                        dS )z
        Return the ``<c:yVal>`` element for this series as unicode text. This
        element contains the Y values for this series.
        rz   rW  re   )r`  rf   rh   r[   ra  rc   rb  rO   s    r6   r  z_XySeriesXmlWriter.yVal_xml  r^  r?   c                     y)z
        The template for the ``<c:xVal>`` element for this series, containing
        the X values and their spreadsheet range reference.
        z<          <c:xVal{nsdecls}>
{numRef_xml}          </c:xVal>
re   rO   s    r6   rX  z_XySeriesXmlWriter._xVal_tmpl       Vr?   c                     y)z
        The template for the ``<c:yVal>`` element for this series, containing
        the Y values and their spreadsheet range reference.
        z<          <c:yVal{nsdecls}>
{numRef_xml}          </c:yVal>
re   rO   s    r6   r`  z_XySeriesXmlWriter._yVal_tmpl  rf  r?   N)rQ   rR   rS   rT   rU   r[  r  rc  r  rX  r`  re   r?   r6   r  r  b  s      " 
 
   " 
 
  V V V Vr?   r  c                  @    e Zd ZdZed        Zed        Zed        Zy)r   zE
    Generates XML snippets particular to a bubble chart series.
    c           
         | j                   j                  di dt        d      z  | j                  | j                  j
                  | j                  j                  | j                  j                        d}t        |      S )z
        Return the ``<c:bubbleSize>`` element for this series as an oxml
        element. This element contains the bubble size values for this
        series.
        rq   rr   rW  re   )	_bubbleSize_tmplrf   r	   rh   r[   bubble_sizes_refrc   bubble_sizesr   rw   s     r6   
bubbleSizez!_BubbleSeriesXmlWriter.bubbleSize  sq     +d##** 	
 73</"ooLL11LL..LL--	
 ~r?   c           
          | j                   j                  di d| j                  | j                  j                  | j                  j
                  | j                  j                        dS )z
        Return the ``<c:bubbleSize>`` element for this series as unicode
        text. This element contains the bubble size values for all the
        data points in the chart.
        rz   rW  re   )rj  rf   rh   r[   rk  rc   rl  rO   s    r6   r  z%_BubbleSeriesXmlWriter.bubbleSize_xml  s_     ,t$$++ 	
"ooLL11LL..LL--	
 		
r?   c                     y)z
        The template for the ``<c:bubbleSize>`` element for this series,
        containing the bubble size values and their spreadsheet range
        reference.
        zH          <c:bubbleSize{nsdecls}>
{numRef_xml}          </c:bubbleSize>
re   rO   s    r6   rj  z'_BubbleSeriesXmlWriter._bubbleSize_tmpl  s     br?   N)rQ   rR   rS   rT   rU   rm  r  rj  re   r?   r6   r   r     sE      $ 
 
" b br?   r   c                      e Zd ZdZd Zy)r9   z7
    A series rewriter suitable for bubble charts.
    c                r   |j                          |j                          |j                          |j                          t	        |      }|j                  |j                         |j                  |j                         |j                  |j                         |j                  |j                         yz
        Rewrite the ``<c:tx>``, ``<c:cat>`` and ``<c:val>`` child elements
        of *ser* based on the values in *series_data*.
        N)
_remove_tx_remove_xVal_remove_yVal_remove_bubbleSizer   
_insert_txrx   _insert_xValr[  _insert_yValrc  _insert_bubbleSizerm  rJ   r   r   r^   r   s        r6   r   z*_BubbleSeriesXmlRewriter._rewrite_ser_data  s    
 	 +K8
z}}%))z445r?   NrQ   rR   rS   rT   r   re   r?   r6   r9   r9     s    6r?   r9   c                      e Zd ZdZd Zy)r<   z9
    A series rewriter suitable for category charts.
    c                   |j                          |j                          |j                          t        ||      }|j	                  |j
                         |j                  |j                         |j                  |j                         yrr  )
rs  _remove_cat_remove_valr   rw  rx   _insert_catr4  _insert_valr   r{  s        r6   r   z,_CategorySeriesXmlRewriter._rewrite_ser_data  s^    
 	-k9E
z}}%
'
'r?   Nr|  re   r?   r6   r<   r<   	  s    (r?   r<   c                      e Zd ZdZd Zy)r:   zB
    A series rewriter suitable for XY (aka. scatter) charts.
    c                   |j                          |j                          |j                          t        |      }|j	                  |j
                         |j                  |j                         |j                  |j                         y)z
        Rewrite the ``<c:tx>``, ``<c:xVal>`` and ``<c:yVal>`` child elements
        of *ser* based on the values in *series_data*.
        N)
rs  rt  ru  r  rw  rx   rx  r[  ry  rc  r{  s        r6   r   z&_XySeriesXmlRewriter._rewrite_ser_data#  sd    
 	'4
z}}%))r?   Nr|  re   r?   r6   r:   r:     s    *r?   r:   N)!rT   
__future__r   copyr   xml.sax.saxutilsr   pptx.enum.chartr   	pptx.oxmlr   pptx.oxml.nsr	   r7   r>   objectrA   rY   r~   r   r   r   r   r$   r'   r+   r   r   r  r   r9   r<   r:   re   r?   r6   <module>r     s(   > "  # )   (.V#.K& K,g
6 g
TM"V M"`]- ]@~, ~BX1 Xvd- dN>, >BB. BJL+ L^z- zzK
3 K
\YV- YVx1b/ 1bh65 6.(!7 (**1 *r?   