o
    7 h                    @  sp  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d	 Zd
d ZG dd deZG dd deZG dd deZG dd deZG dd deZG dd deZG dd deZG dd deZG dd deZG dd deZG d d! d!eZG d"d# d#eZG d$d% d%eZG d&d' d'eZG d(d) d)eZG d*d+ d+eZG d,d- d-eZ d.S )/z8Composers for default chart XML for various chart types.    )annotations)deepcopyescape)XL_CHART_TYPE)	parse_xml)nsdeclsc                 C  s
  t }zpi |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|jt|jt|jt|jt|jt|jt|j t!|j"t!|j#t!|j$t!|j%t!i|  }W n t&y   t'd|  w || |S )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_CTZ
BuilderCls r3   \/var/www/html/figdemos/bartoux_crm/venv/lib/python3.10/site-packages/pptx/chart/xmlwriter.pyChartXmlWriter   sp   	

r5   c                 C  sB   t }|jt|jt|jt|jt|jt|jt|j	ti
| t}||S )zQ
    Return a |_BaseSeriesXmlRewriter| subclass appropriate to *chart_type*.
    )r   r   _BubbleSeriesXmlRewriterr   r(   _XySeriesXmlRewriterr*   r+   r,   r-   get_CategorySeriesXmlRewriter)r0   r1   r2   ZRewriterClsr3   r3   r4   SeriesXmlRewriterFactory8   s   r:   c                      s,   e Zd ZdZ fddZedd Z  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                   s(   t t|   || _|| _t|| _d S N)superr;   __init___chart_type_chart_datalistZ_series_seq)selfr0   Z
series_seq	__class__r3   r4   r>   V   s   z_BaseChartXmlWriter.__init__c                 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r/   rB   r3   r3   r4   xml\   s   z_BaseChartXmlWriter.xml)__name__
__module____qualname____doc__r>   propertyrH   __classcell__r3   r3   rC   r4   r;   O   s
    r;   c                      sb   e Zd ZdZd fdd	Zedd Zdd Zd	d
 Zedd Z	edd Z
edd Z  ZS )_BaseSeriesXmlWriterz9
    Provides shared members for series XML writers.
    Fc                   s   t t|   || _|| _d S r<   )r=   rO   r>   _series
_date_1904)rB   series	date_1904rC   r3   r4   r>   j   s   
z_BaseSeriesXmlWriter.__init__c                 C  s   t | jjS )z7
        The XML-escaped name for this series.
        )r   rP   namerG   r3   r3   r4   rT   o   s   z_BaseSeriesXmlWriter.namec                 C  s"   |  |}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_xmlNr3   )rW   format)rB   rU   rV   valuesrW   r3   r3   r4   
numRef_xmlv   s   

z_BaseSeriesXmlWriter.numRef_xmlc                 C  sF   dj t|d}d}t|D ]\}}|du rq||j ||d7 }q|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}"/>
)Zpt_countz`                <c:pt idx="{idx}">
                  <c:v>{value}</c:v>
                </c:pt>
N)idxvalue)rX   len	enumerate)rB   rY   rH   Zpt_tmplr[   r\   r3   r3   r4   rW      s   	z_BaseSeriesXmlWriter.pt_xmlc                 C  s0   | j jdi | jj| jdtd d}t|S )zg
        Return a ``<c:tx>`` oxml element for this series, containing the
        series name.
         %scrU   Zseries_namer   Nr3   )_tx_tmplrX   rP   name_refrT   r   r   rB   rH   r3   r3   r4   tx   s   

z_BaseSeriesXmlWriter.txc                 C  s    | 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.
         ra   Nr3   )rb   rX   rP   rc   rT   rG   r3   r3   r4   tx_xml   s   
z_BaseSeriesXmlWriter.tx_xmlc                 C     	 dS )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>
r3   rG   r3   r3   r4   rb         z_BaseSeriesXmlWriter._tx_tmpl)F)rI   rJ   rK   rL   r>   rM   rT   rZ   rW   re   rg   rb   rN   r3   r3   rC   r4   rO   e   s    


rO   c                      sH   e Zd ZdZ fddZdd Zdd Zdd	 Zd
d Zdd Z	  Z
S )_BaseSeriesXmlRewriterz.
    Base class for series XML rewriters.
    c                   s   t t|   || _d S r<   )r=   rj   r>   r@   )rB   r1   rC   r3   r4   r>      s   
z_BaseSeriesXmlRewriter.__init__c                 C  sL   |j |j}}| j}| |t| t|j|D ]\}}| ||| qdS )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)plotArearS   r@   _adjust_ser_countr]   zipsers_rewrite_ser_data)rB   
chartSpacerk   rS   r1   serseries_datar3   r3   r4   replace_series_data   s   
z*_BaseSeriesXmlRewriter.replace_series_datac                   s,    fdd} j }t|D ]}||}qdS )z
        Add `c:ser` elements to the last xChart element in *plotArea*, cloned
        from the last `c:ser` child of that last xChart.
        c                   s*   t | } j|j_ j|j_| | |S r<   )r   next_idxr[   val
next_orderorderaddnext)rq   Znew_serrk   r3   r4   	clone_ser   s
   


z:_BaseSeriesXmlRewriter._add_cloned_sers.<locals>.clone_serN)last_serrange)rB   rk   countrz   r{   _r3   ry   r4   _add_cloned_sers   s
   
z'_BaseSeriesXmlRewriter._add_cloned_sersc                 C  sF   |t |j }|dkr| || dS |dk r!| |t| dS dS )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)r]   rn   r   _trim_ser_count_byabs)rB   rk   Znew_ser_countZser_count_diffr3   r3   r4   rl      s   	z(_BaseSeriesXmlRewriter._adjust_ser_countc                 C  rE   )zh
        Rewrite selected child elements of *ser* based on the values in
        *series_data*.
        z$must be implemented by each subclassrF   )rB   rq   rr   rS   r3   r3   r4   ro     s   z(_BaseSeriesXmlRewriter._rewrite_ser_datac                 C  s^   |j | d }|D ]}| }|| q
dd | D }|D ]}| }|| q!dS )z
        Remove the last *count* ser elements from *plotArea*. Any xChart
        elements having no ser child elements after trimming are also
        removed.
        Nc                 S  s   g | ]}t |jd kr|qS )r   )r]   rn   ).0xChartr3   r3   r4   
<listcomp>  s    z=_BaseSeriesXmlRewriter._trim_ser_count_by.<locals>.<listcomp>)rn   	getparentremoveiter_xCharts)rB   rk   r}   Z
extra_sersrq   parentZextra_xChartsr   r3   r3   r4   r     s   z)_BaseSeriesXmlRewriter._trim_ser_count_by)rI   rJ   rK   rL   r>   rs   r   rl   ro   r   rN   r3   r3   rC   r4   rj      s    rj   c                   @  @   e Zd ZdZedd Zedd Zedd Zedd	 Zd
S )r
   zS
    Provides specialized methods particular to the ``<c:areaChart>`` element.
    c                 C     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_xmlr3   rX   _grouping_xml_ser_xml_cat_ax_xmlrG   r3   r3   r4   rH   $  s   @Cz_AreaChartXmlWriter.xmlc                 C  *   | j j}|jrdjdi d|jiS 	 dS )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>
r3   r@   
categories	are_datesrX   rV   rB   r   r3   r3   r4   r   o     z_AreaChartXmlWriter._cat_ax_xmlc                 C  s$   t jdt jdt jdi| j }d| S )NstandardstackedpercentStackedz        <c:grouping val="%s"/>
)r   r	   r   r   r?   )rB   ru   r3   r3   r4   r     s   z!_AreaChartXmlWriter._grouping_xmlc                 C  F   d}| j D ]}t|}|djdi |j|j|j|j|jd7 }q|S Nrf   z        <c:ser>
          <c:idx val="{ser_idx}"/>
          <c:order val="{ser_order}"/>
{tx_xml}{cat_xml}{val_xml}        </c:ser>
)ser_idx	ser_orderrg   cat_xmlval_xmlr3   r@   _CategorySeriesXmlWriterrX   indexrg   r   r   rB   rH   rR   
xml_writerr3   r3   r4   r        


z_AreaChartXmlWriter._ser_xmlN)	rI   rJ   rK   rL   rM   rH   r   r   r   r3   r3   r3   r4   r
     s    
J
-
r
   c                   @  sp   e Zd ZdZedd Zedd Zedd Zedd	 Zed
d Z	edd Z
edd Zedd ZdS )r   zR
    Provides specialized methods particular to the ``<c:barChart>`` element.
    c              
   C  s*   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>
)Z
barDir_xmlr   r   Zoverlap_xmlr   Z
val_ax_posr3   )rX   _barDir_xmlr   r   _overlap_xmlr   _val_ax_posrG   r3   r3   r4   rH     s   ,/z_BarChartXmlWriter.xmlc                 C  sN   t }|j|j|jf}|j|j|jf}| j|v rdS | j|v r dS td| j )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   r?   r/   )rB   XLZ	bar_typesZ	col_typesr3   r3   r4   r     s   

z_BarChartXmlWriter._barDir_xmlc                 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   r?   rG   r3   r3   r4   _cat_ax_pos	     z_BarChartXmlWriter._cat_ax_posc                 C  s>   | 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   r3   )r@   r   r   rX   r   rV   r   r3   r3   r4   r     s   z_BarChartXmlWriter._cat_ax_xmlc                 C  `   t }|j|jf}|j|jf}|j|jf}| j|v rdS | j|v r"dS | j|v r)dS td| j )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   r?   r/   )rB   r   Zclustered_typesstacked_typespercentStacked_typesr3   r3   r4   r   A     


z _BarChartXmlWriter._grouping_xmlc                 C  s*   t }|j|j|j|jf}| j|v rdS dS )Nz        <c:overlap val="100"/>
rf   )r   r   r   r   r   r?   )rB   r   r   r3   r3   r4   r   O  s   
z_BarChartXmlWriter._overlap_xmlc                 C  r   r   r   r   r3   r3   r4   r   \  r   z_BarChartXmlWriter._ser_xmlc                 C  r   )Nr   r   r   rG   r3   r3   r4   r   t  r   z_BarChartXmlWriter._val_ax_posN)rI   rJ   rK   rL   rM   rH   r   r   r   r   r   r   r   r3   r3   r3   r4   r     s$    
9




,


r   c                   @  4   e Zd ZdZedd Zedd Zedd ZdS )	r   z[
    Provides specialized methods particular to the ``<c:doughnutChart>``
    element.
    c                 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   r3   rX   r   rG   r3   r3   r4   rH     s
   /0z_DoughnutChartXmlWriter.xmlc                 C     | j tjkrdS dS Nz"          <c:explosion val="25"/>
rf   )r?   r   r   rG   r3   r3   r4   _explosion_xml     z&_DoughnutChartXmlWriter._explosion_xmlc                 C  J   d}| j D ]}t|}|djdi |j|j|j| j|j|jd7 }q|S )Nrf   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   rg   explosion_xmlr   r   r3   )r@   r   rX   r   rg   r   r   r   r   r3   r3   r4   r     s    

z _DoughnutChartXmlWriter._ser_xmlNrI   rJ   rK   rL   rM   rH   r   r   r3   r3   r3   r4   r     s    
3
r   c                   @  L   e Zd ZdZedd Zedd Zedd Zedd	 Zed
d Z	dS )r   zS
    Provides specialized methods particular to the ``<c:lineChart>`` element.
    c                 C  r   )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   r3   r   rG   r3   r3   r4   rH     s   47z_LineChartXmlWriter.xmlc                 C  r   )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>
r3   r   r   r3   r3   r4   r     r   z_LineChartXmlWriter._cat_ax_xmlc                 C  r   )Nz%        <c:grouping val="standard"/>
r   r   r   )	r   r   r   r   r   r    r   r?   r/   )rB   r   Zstandard_typesr   r   r3   r3   r4   r   L  r   z!_LineChartXmlWriter._grouping_xmlc                 C  s(   t }|j|j|jf}| j|v r	 dS dS NzN          <c:marker>
            <c:symbol val="none"/>
          </c:marker>
rf   )r   r   r   r    r?   )rB   r   no_marker_typesr3   r3   r4   _marker_xmlZ  s   
z_LineChartXmlWriter._marker_xmlc                 C  r   Nrf   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   rg   
marker_xmlr   r   r3   r@   r   rX   r   rg   r   r   r   r   r3   r3   r4   r   f      
	
z_LineChartXmlWriter._ser_xmlN)
rI   rJ   rK   rL   rM   rH   r   r   r   r   r3   r3   r3   r4   r     s    
>
,

r   c                   @  r   )	r"   zR
    Provides specialized methods particular to the ``<c:pieChart>`` element.
    c                 C  r   )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   r3   r   rG   r3   r3   r4   rH     s
   z_PieChartXmlWriter.xmlc                 C  r   r   )r?   r   r#   rG   r3   r3   r4   r     r   z!_PieChartXmlWriter._explosion_xmlc                 C  s4   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>
)rg   r   r   r   r3   )r   r@   rX   rg   r   r   r   )rB   r   rH   r3   r3   r4   r     s   z_PieChartXmlWriter._ser_xmlNr   r3   r3   r3   r4   r"     s    

r"   c                   @  r   )r%   z;
    Generates XML for the ``<c:radarChart>`` element.
    c                 C  s   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   r3   )rX   _radar_styler   rG   r3   r3   r4   rH     s
   OPz_RadarChartXmlWriter.xmlc                 C     | j tjkr		 dS dS r   )r?   r   r$   rG   r3   r3   r4   r     s   z _RadarChartXmlWriter._marker_xmlc                 C  r   )Nfilledmarker)r?   r   r&   rG   r3   r3   r4   r   &  r   z!_RadarChartXmlWriter._radar_stylec                 C  r   r   r   r   r3   r3   r4   r   ,  r   z_RadarChartXmlWriter._ser_xmlN)	rI   rJ   rK   rL   rM   rH   r   r   r   r3   r3   r3   r4   r%     s    
S
	
r%   c                   @  r   )r)   z=
    Generates XML for the ``<c:scatterChart>`` element.
    c                 C  s   d| j | jf }|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:plotArea>
      <c:scatterChart>
        <c:scatterStyle val="%s"/>
        <c:varyColors val="0"/>
%s        <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   rd   r3   r3   r4   rH   M  s   
BDz_XyChartXmlWriter.xmlc                 C  s    t jt jf}| j|v r	 dS dS r   )r   r+   r-   r?   )rB   r   r3   r3   r4   r     s   
z_XyChartXmlWriter._marker_xmlc                 C  s   t jt jf}| j|v rdS dS )NsmoothMarker
lineMarker)r   r,   r-   r?   )rB   Zsmooth_typesr3   r3   r4   r     s   
z#_XyChartXmlWriter._scatterStyle_valc                 C  sN   d}| j D ]}t|}|djdi |j|j|j| j| j|j|jd7 }q|S )Nrf   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   rg   ZspPr_xmlr   xVal_xmlyVal_xmlr3   )	r@   _XySeriesXmlWriterrX   r   rg   	_spPr_xmlr   r   r   r   r3   r3   r4   r     "   


z_XyChartXmlWriter._ser_xmlc                 C  r   )Nzr          <c:spPr>
            <a:ln w="47625">
              <a:noFill/>
            </a:ln>
          </c:spPr>
rf   )r?   r   r(   rG   r3   r3   r4   r     s   z_XyChartXmlWriter._spPr_xmlN)
rI   rJ   rK   rL   rM   rH   r   r   r   r   r3   r3   r3   r4   r)   H  s    
G

	
r)   c                   @  r   )	r   zY
    Provides specialized methods particular to the ``<c:bubbleChart>``
    element.
    c                 C  s   d| j  }|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   rd   r3   r3   r4   rH     s   MOz_BubbleChartXmlWriter.xmlc                 C  r   )N10)r?   r   r   rG   r3   r3   r4   _bubble3D_val0  r   z#_BubbleChartXmlWriter._bubble3D_valc                 C  sN   d}| j D ]}t|}|djdi |j|j|j|j|j|j| jd7 }q|S )Nrf   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   rg   r   r   bubbleSize_xmlZbubble3D_valr3   )	r@   _BubbleSeriesXmlWriterrX   r   rg   r   r   r   r   r   r3   r3   r4   r   6  r   z_BubbleChartXmlWriter._ser_xmlN)rI   rJ   rK   rL   rM   rH   r   r   r3   r3   r3   r4   r     s    
R
r   c                   @  s   e Zd ZdZedd Zedd Zedd Zedd	 Zed
d Z	edd Z
edd Zdd Zedd Zedd Zedd Zedd ZdS )r   zG
    Generates XML snippets particular to a category chart series.
    c                 C  s   | j j}|jr!t| jjdi | j j|j|j| j	dt
d dS |jdkr>t| jjdi | j j|j| jdt
d dS t| jjdi | j j|j| |dt
d dS )	za
        Return the ``<c:cat>`` element XML for this series, as an oxml
        element.
        r_   r`   rU   rV   	cat_count
cat_pt_xmlr      rU   r   r   r   rU   r   Zlvl_xmlr   Nr3   )rP   r   are_numericr   _numRef_cat_tmplrX   categories_refrV   
leaf_count_cat_num_pt_xmlr   depth	_cat_tmpl_cat_pt_xml_multiLvl_cat_tmpl_lvl_xmlr   r3   r3   r4   catY  s>   






z_CategorySeriesXmlWriter.catc              	   C  s   | j j}|jr| jjdi | j j|j|j| jddS |j	dkr2| j
jdi | j j|j| jddS | jjdi | 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.
        rf   r   r   r   r   Nr3   )rP   r   r   r   rX   r   rV   r   r   r   r   r   r   r   r   r3   r3   r4   r     s2   




	z _CategorySeriesXmlWriter.cat_xmlc              	   C  s>   | j jdi dtd | jj| jjt| j| jd}t|S )zJ
        The ``<c:val>`` XML for this series, as an oxml element.
        r_   r`   r   
values_refrV   Z	val_countZ
val_pt_xmlNr3   )		_val_tmplrX   r   rP   r   rV   r]   _val_pt_xmlr   rd   r3   r3   r4   ru     s   

	z_CategorySeriesXmlWriter.valc              	   C  s.   | 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.
        rf   r   Nr3   )r   rX   rP   r   rV   r]   r   rG   r3   r3   r4   r     s   
z _CategorySeriesXmlWriter.val_xmlc              	   C  s@   d}t | jjD ]\}}|djdi ||| jd7 }q|S )z
        The unicode XML snippet for the ``<c:pt>`` elements when category
        labels are numeric (including date type).
        rf   zj                <c:pt idx="{cat_idx}">
                  <c:v>{cat_lbl_str}</c:v>
                </c:pt>
)cat_idxZcat_lbl_strNr3   )r^   rP   r   rX   Znumeric_str_valrQ   rB   rH   r[   categoryr3   r3   r4   r     s   


z(_CategorySeriesXmlWriter._cat_num_pt_xmlc              	   C  sB   d}t | jjD ]\}}|djdi |tt|jd7 }q|S )z|
        The unicode XML snippet for the ``<c:pt>`` elements containing the
        category names for this series.
        rf   zh                <c:pt idx="{cat_idx}">
                  <c:v>{cat_label}</c:v>
                </c:pt>
)r   Z	cat_labelNr3   )r^   rP   r   rX   r   strlabelr   r3   r3   r4   r     s   
z$_CategorySeriesXmlWriter._cat_pt_xmlc                 C  rh   )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>
r3   rG   r3   r3   r4   r     ri   z"_CategorySeriesXmlWriter._cat_tmplc                 C  s8   dd }d}|j D ]}|djdi d||i7 }q	|S )zu
        The unicode XML snippet for the ``<c:lvl>`` elements containing
        multi-level category names.
        c                 S  s.   d}| D ]\}}|d|t d| f 7 }q|S )Nrf   z^                  <c:pt idx="%d">
                    <c:v>%s</c:v>
                  </c:pt>
z%sr   )levelrH   r[   rT   r3   r3   r4   
lvl_pt_xml  s   z5_CategorySeriesXmlWriter._lvl_xml.<locals>.lvl_pt_xmlrf   z=                <c:lvl>
{lvl_pt_xml}                </c:lvl>
r   Nr3   )levelsrX   )rB   r   r   rH   r   r3   r3   r4   r     s   




z!_CategorySeriesXmlWriter._lvl_xmlc                 C  rh   )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>
r3   rG   r3   r3   r4   r     ri   z+_CategorySeriesXmlWriter._multiLvl_cat_tmplc                 C  rh   )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>
r3   rG   r3   r3   r4   r   *  ri   z)_CategorySeriesXmlWriter._numRef_cat_tmplc                 C  sB   d}t | jjD ]\}}|du rq|djdi ||d7 }q|S )z{
        The unicode XML snippet containing the ``<c:pt>`` elements containing
        the values for this series.
        rf   Nzf                <c:pt idx="{val_idx:d}">
                  <c:v>{value}</c:v>
                </c:pt>
)Zval_idxr\   r3   )r^   rP   rY   rX   )rB   rH   r[   r\   r3   r3   r4   r   =  s   
z$_CategorySeriesXmlWriter._val_pt_xmlc                 C  rh   )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>
r3   rG   r3   r3   r4   r   N  ri   z"_CategorySeriesXmlWriter._val_tmplN)rI   rJ   rK   rL   rM   r   r   ru   r   r   r   r   r   r   r   r   r   r3   r3   r3   r4   r   T  s2    
+
%







r   c                   @  sX   e Zd ZdZedd Zedd Zedd Zedd	 Zed
d Z	edd Z
dS )r   z<
    Generates XML snippets particular to an XY series.
    c              	   C  >   | j jdi dtd | | 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.
        r_   r`   r   rZ   Nr3   )	
_xVal_tmplrX   r   rZ   rP   x_values_refrV   x_valuesr   rd   r3   r3   r4   xValg     


z_XySeriesXmlWriter.xValc              	   C  .   | j jdi d| | 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.
        rf   r   Nr3   )r   rX   rZ   rP   r   rV   r   rG   r3   r3   r4   r   y     
z_XySeriesXmlWriter.xVal_xmlc              	   C  r   )z
        Return the ``<c:yVal>`` element for this series as an oxml element.
        This element contains the Y values for this series.
        r_   r`   r   Nr3   )	
_yVal_tmplrX   r   rZ   rP   y_values_refrV   y_valuesr   rd   r3   r3   r4   yVal  r  z_XySeriesXmlWriter.yValc              	   C  r  )z
        Return the ``<c:yVal>`` element for this series as unicode text. This
        element contains the Y values for this series.
        rf   r   Nr3   )r  rX   rZ   rP   r  rV   r  rG   r3   r3   r4   r     r  z_XySeriesXmlWriter.yVal_xmlc                 C     dS )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>
r3   rG   r3   r3   r4   r        z_XySeriesXmlWriter._xVal_tmplc                 C  r	  )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>
r3   rG   r3   r3   r4   r    r
  z_XySeriesXmlWriter._yVal_tmplN)rI   rJ   rK   rL   rM   r  r   r  r   r   r  r3   r3   r3   r4   r   b  s    




r   c                   @  r   )	r   zE
    Generates XML snippets particular to a bubble chart series.
    c              	   C  r   )z
        Return the ``<c:bubbleSize>`` element for this series as an oxml
        element. This element contains the bubble size values for this
        series.
        r_   r`   r   Nr3   )	_bubbleSize_tmplrX   r   rZ   rP   bubble_sizes_refrV   bubble_sizesr   rd   r3   r3   r4   
bubbleSize  s   


z!_BubbleSeriesXmlWriter.bubbleSizec              	   C  r  )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.
        rf   r   Nr3   )r  rX   rZ   rP   r  rV   r  rG   r3   r3   r4   r     s   
z%_BubbleSeriesXmlWriter.bubbleSize_xmlc                 C  r	  )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>
r3   rG   r3   r3   r4   r    s   z'_BubbleSeriesXmlWriter._bubbleSize_tmplN)rI   rJ   rK   rL   rM   r  r   r  r3   r3   r3   r4   r     s    

r   c                   @     e Zd ZdZdd ZdS )r6   z7
    A series rewriter suitable for bubble charts.
    c                 C  s\   |   |  |  |  t|}||j ||j |	|j
 ||j dS 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_txre   _insert_xValr  _insert_yValr  _insert_bubbleSizer  rB   rq   rr   rS   r   r3   r3   r4   ro     s   z*_BubbleSeriesXmlRewriter._rewrite_ser_dataNrI   rJ   rK   rL   ro   r3   r3   r3   r4   r6         r6   c                   @  r  )r9   z9
    A series rewriter suitable for category charts.
    c                 C  sJ   |   |  |  t||}||j ||j ||j	 dS r  )
r  _remove_cat_remove_valr   r  re   _insert_catr   _insert_valru   r  r3   r3   r4   ro     s   
z,_CategorySeriesXmlRewriter._rewrite_ser_dataNr  r3   r3   r3   r4   r9   	  r  r9   c                   @  r  )r7   zB
    A series rewriter suitable for XY (aka. scatter) charts.
    c                 C  sH   |   |  |  t|}||j ||j ||j	 dS )z
        Rewrite the ``<c:tx>``, ``<c:xVal>`` and ``<c:yVal>`` child elements
        of *ser* based on the values in *series_data*.
        N)
r  r  r  r   r  re   r  r  r  r  r  r3   r3   r4   ro   #  s   z&_XySeriesXmlRewriter._rewrite_ser_dataNr  r3   r3   r3   r4   r7     r  r7   N)!rL   
__future__r   copyr   xml.sax.saxutilsr   pptx.enum.chartr   	pptx.oxmlr   pptx.oxml.nsr   r5   r:   objectr;   rO   rj   r
   r   r   r   r"   r%   r)   r   r   r   r   r6   r9   r7   r3   r3   r3   r4   <module>   sB    +jP ! B[ (A  }  \4