
    fv                        d dl Z d dl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	lmZ dd
lmZ ddlmZ  G d dej                  ZdS )    Nwarn   )Shape)	xmlwriter)get_rgb_color)xl_rowcol_to_cell)xl_range_formula)supported_datetime)datetime_to_excel_datetime)quote_sheetnamec                       e Zd ZdZdӈ fd	ZddZd Zd Zd Zd Z	dd	Z
d
 Zd Zd Zd Zd Zd Zd ZddZddZddZddZddZddZd Zd Zd Zd Zd Zd Zd Zd Zd Z d  Z!d! Z"d" Z#d# Z$d$ Z%dd%Z&d& Z'd' Z(d( Z)d) Z*d* Z+d+ Z,d, Z-d- Z.d. Z/d/ Z0d0 Z1d1 Z2d2 Z3d3 Z4d4 Z5d5 Z6d6 Z7d7 Z8d8 Z9d9 Z:d: Z;d; Z<d< Z=d= Z>d> Z?d? Z@d@ ZAdA ZBdB ZCdC ZDdD ZEdE ZFdF ZGdG ZHdH ZIdI ZJdJ ZKdK ZLdL ZMdM ZNdN ZOdO ZPdP ZQdQ ZRdR ZSdS ZTdT ZUdU ZVdV ZWdW ZXddXZYdY ZZddZZ[d[ Z\d\ Z]dd]Z^d^ Z_d_ Z`d` Zada Zbdb Zcdc Zddd Zede ZfddfZgddgZhdh Zidi Zjdj Zkdk Zldl Zmdm Zndn Zodo Zpdp Zqdq ZrddsZs	 ddtZtdu Zudv Zvdw Zwdx Zxdy Zydz Zzd{ Z{d| Z|d} Z}d~ Z~d Zd Zd Zd ZddZd Zd Zd Zd Zd Zd Zd ZddZd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd ZdÄ ZdĄ Zdń ZdƄ ZdǄ ZdȄ ZdɄ Zdʄ Zd˄ Zd̄ Zd̈́ Zd΄ Zdτ ZdЄ Zdф Zd҄ Z҈ xZS )Chartz:
    A class for writing the Excel XLSX Chart file.


    Nc                    t          t          |                                            d| _        d| _        d| _        g | _        d| _        d| _        d| _	        d| _
        g | _        g | _        d| _        d| _        i | _        d| _        d| _        i | _        g | _        d| _        d	| _        d| _        i | _        i | _        i | _        i | _        i | _        i | _        d
| _        d| _        d| _        d| _         d	| _!        d| _"        d| _#        d	| _$        d	| _%        d| _&        d| _'        d| _(        d| _)        d| _*        d| _+        d| _,        d| _-        d| _.        d| _/        d| _0        d| _1        d| _2        d| _3        d| _4        d| _5        d| _6        d| _7        d| _8        d| _9        d| _:        d| _;        d| _<        i | _=        d
| _>        d| _?        d| _@        d| _A        d| _B        | C                                 dS )z
        Constructor.

        Ni   r      Fblr    gapi  i   betweenT)Dsuperr   __init__subtype
sheet_typeorientationseriesembeddedidseries_indexstyle_idaxis_ids	axis2_idscat_has_num_fmtrequires_categorylegendcat_axis_positionval_axis_positionformula_idsformula_datahoriz_cat_axishoriz_val_axis
protection	chartareaplotareax_axisy_axisy2_axisx2_axis
chart_nameshow_blanksshow_na_as_emptyshow_hiddenshow_crosseswidthheightx_scaley_scalex_offsety_offsettablecross_betweendefault_markerseries_gap_1series_gap_2series_overlap_1series_overlap_2
drop_lineshi_low_linesup_down_barssmooth_allowed
title_font
title_nametitle_formulatitle_data_idtitle_layouttitle_overlay
title_nonedate_category	date_1904remove_timezonelabel_positionslabel_position_defaultalready_insertedcombinedis_secondarywarn_sheetname_set_default_properties)selfoptions	__class__s     R/var/www/ffwdstore.be/apps/py-env/lib/python3.11/site-packages/xlsxwriter/chart.pyr   zChart.__init__#   s    	eT##%%%  !&!$!$  % 

&"   $ $  #!! !"$!&(# %!"$$&&&&&    c                    |i }d|vrt          d           dS | j        rd|vrt          d           dS t          | j                  dk    rt          d           dS |                     |                    d                    }|                     |                    d                    }|                     |                    d          |                    d	                    \  }}|                     ||                    d
                    }|                     ||                    d                    }|                     ||                    d                    }t          j	        |                    d                    }	|                    d          rt          j	        |d                   }	t          j
        |                    d                    }
t          j        |                    d                    }t          j        |                    d                    }|rd| _        |rd}d}
|                     |                    d                    }|                     |                    d                    }|                    d          }|                     |                    d                    }|                     |                    d                    }||d}|                     |                    d                    }|                     |                    d                    }|                    dd          }|                    dd          }|                    d          }|                    d          }|s|rd| _        |                    d           |r|d          | _        n|d          | _        |                    d!          r|r|d!         | _        n|d!         | _        i d|d|d|d	|d"|d#|d$|d|	d|
d|d|d|d|d%|d&|d'|d|||||d(}| j                            |           dS ))z
        Add a data series to a chart.

        Args:
            options:  A dictionary of chart series options.

        Returns:
            Nothing.

        Nvaluesz%Must specify 'values' in add_series()
categoriesz=Must specify 'categories' in add_series() for this chart type   zGThe maximum number of series that can be added to an Excel Chart is 255namename_formulacategories_datavalues_data	name_datalineborderfillpatterngradientmarker	trendlinesmoothy_error_barsx_error_bars)rr   rq   pointsdata_labelsinvert_if_negativeFinvert_if_negative_colorr3   r2   Tr   overlapname_idval_data_idcat_data_idlabelsinvert_if_neginverted_color)r2   rs   
error_barsrp   )r   r%   lenr   _list_to_formulaget_process_names_get_data_idr   _get_line_properties_get_fill_properties_get_pattern_properties_get_gradient_propertiesrk   _get_marker_properties_get_trendline_properties_get_error_bars_props_get_points_properties_get_labels_propertiesrX   rC   rB   rE   rD   append)r[   r\   ra   rb   rd   re   cat_idval_idrx   ri   rk   rl   rm   rn   ro   rp   rq   rr   r~   rs   r{   r|   r}   r3   r2   r   s                             r^   
add_serieszChart.add_seriesm   s    ?G 7""8999F! 	l'&A&APQQQFt{s""%   F &&w{{8'<'<==**7;;|+D+DEE
 "00KK^!<!<
 
l
 "":w{{;L/M/MNN""67;;}+E+EFF##L'++k2J2JKK )'++f*=*=>> ;;x   	A-gh.?@@D )'++f*=*=>> /I0F0FGG 1'++j2I2IJJ  	DI  	GD ,,W[[-B-BCC 227;;{3K3KLL	 X&& 11'++n2M2MNN11'++n2M2MNN&2LQQ
 ,,W[[-B-BCC ,,W[[-G-GHH  $8%@@ %?GG ++i((++i((  	%g 	% $D ;;u) 3$+EN!!$+EN! ;;y!! 	; ;(/	(:%%(/	(:%
f
*
 D
 L	

 w
 6
 6
 D
 D
 w
 
 f
 
 f
 ]
  n!
" w#
$ $+
 
 
0 	6"""""r_   c                 J    |                      | j        |          }|| _        dS )z
        Set the chart X axis options.

        Args:
            options:  A dictionary of axis options.

        Returns:
            Nothing.

        N)_convert_axis_argsr0   r[   r\   axiss      r^   
set_x_axiszChart.set_x_axis   &     &&t{G<<r_   c                 J    |                      | j        |          }|| _        dS )z
        Set the chart Y axis options.

        Args:
            options: A dictionary of axis options.

        Returns:
            Nothing.

        N)r   r1   r   s      r^   
set_y_axiszChart.set_y_axis  r   r_   c                 J    |                      | j        |          }|| _        dS )z
        Set the chart secondary X axis options.

        Args:
            options: A dictionary of axis options.

        Returns:
            Nothing.

        N)r   r3   r   s      r^   set_x2_axiszChart.set_x2_axis  &     &&t|W==r_   c                 J    |                      | j        |          }|| _        dS )z
        Set the chart secondary Y axis options.

        Args:
            options: A dictionary of axis options.

        Returns:
            Nothing.

        N)r   r2   r   s      r^   set_y2_axiszChart.set_y2_axis*  r   r_   c                 &   |i }|                      |                    d          |                    d                    \  }}|                     ||                    d                    }|| _        || _        || _        |                     |                    d                    | _        |                     |                    d          d          | _	        |                    d          | _
        |                    d	          | _        dS )
z
        Set the chart title options.

        Args:
            options: A dictionary of chart title options.

        Returns:
            Nothing.

        Nrd   re   data	name_fontlayoutToverlaynone)r   r   r   rK   rL   rM   _convert_font_argsrJ   _get_layout_propertiesrN   rO   rP   )r[   r\   rd   re   data_ids        r^   	set_titlezChart.set_title9  s     ?G!00KK^!<!<
 
l ##L'++f2E2EFF)$ 11'++k2J2JKK !77H8M8MtTT$[[33 "++f--r_   c                 :    |                      |          | _        dS )z
        Set the chart legend options.

        Args:
            options: A dictionary of chart legend options.

        Returns:
            Nothing.
        N)_get_legend_propertiesr&   r[   r\   s     r^   
set_legendzChart.set_legend\  s     11'::r_   c                 :    |                      |          | _        dS )z
        Set the chart plot area options.

        Args:
            options: A dictionary of chart plot area options.

        Returns:
            Nothing.
        N)_get_area_propertiesr/   r   s     r^   set_plotareazChart.set_plotareai  s     11'::r_   c                 :    |                      |          | _        dS )z
        Set the chart area options.

        Args:
            options: A dictionary of chart area options.

        Returns:
            Nothing.
        N)r   r.   r   s     r^   set_chartareazChart.set_chartareav  s     227;;r_   c                 8    |d}|dk     s|dk    rd}|| _         dS )z
        Set the chart style type.

        Args:
            style_id: An int representing the chart style.

        Returns:
            Nothing.
        Nr   r   0   )r!   )r[   r!   s     r^   	set_stylezChart.set_style  s0     Ha<<8b==H r_   c                 X    |sdS dddd}||vrt          d|z             dS || _        dS )z
        Set the option for displaying blank data in a chart.

        Args:
            option: A string representing the display option.

        Returns:
            Nothing.
        Nr   )r   zerospanz$Unknown show_blanks_as() option '%s')r   r5   )r[   optionvalid_optionss      r^   show_blanks_aszChart.show_blanks_as  s\      	F 
 
 &&7&@AAAF!r_   c                     d| _         dS )z
        Display ``#N/A`` on charts as blank/empty cells.

        Args:
            None.

        Returns:
            Nothing.
        TN)r6   r[   s    r^   show_na_as_empty_cellzChart.show_na_as_empty_cell  s     !%r_   c                     d| _         dS )z
        Display data on charts from hidden rows or columns.

        Args:
            None.

        Returns:
            Nothing.
        TN)r7   r   s    r^   show_hidden_datazChart.show_hidden_data  s      r_   c                 f   |i }|                     d| j                  | _        |                     d| j                  | _        |                     dd          | _        |                     dd          | _        |                     dd          | _        |                     d	d          | _        dS )
z
        Set size or scale of the chart.

        Args:
            options: A dictionary of chart size options.

        Returns:
            Nothing.
        Nr9   r:   r;   r   r<   r=   r   r>   )r   r9   r:   r;   r<   r=   r>   r   s     r^   set_sizezChart.set_size  s     ?G [[$*55
kk(DK88{{9a00{{9a00J22J22r_   c                 >   |i }i }|                     dd          |d<   |                     dd          |d<   |                     dd          |d<   |                     dd          |d<   |                     |                     d                    |d<   || _        dS )	z
        Set properties for an axis data table.

        Args:
            options: A dictionary of axis table options.

        Returns:
            Nothing.

        N
horizontalr   verticaloutline	show_keysr   font)r   r   r?   )r[   r\   r?   s      r^   	set_tablezChart.set_table  s     ?G%kk,::l#KK
A66j";;y!44i$[[a88k//F0C0CDDf


r_   c                    |i }d}d}d}d}|                     d          r~d|d         v r t          j        |d         d                   }d|d         v r t          j        |d         d                   }d|d         v r t          j        |d         d                   }|                     d          r~d|d         v r t          j        |d         d                   }d|d         v r t          j        |d         d                   }d|d         v r t          j        |d         d                   }||d||dd| _        dS )	z
        Set properties for the chart up-down bars.

        Args:
            options: A dictionary of options.

        Returns:
            Nothing.

        Nuprj   ri   rk   down)ri   rk   )r   r   )r   r   r   r   rH   )r[   r\   up_lineup_fill	down_line	down_fills         r^   set_up_down_barszChart.set_up_down_bars  s{    ?G 		 ;;t 		L74=((4WT]85LMM&&4WT]65JKK&&4WT]65JKK ;;v 		P76?**!6wvx7PQQ	((!6wvv7NOO	((!6wvv7NOO	   
 "! 	
 	
r_   c                 |   |i }t          j        |                    d                    }t          j        |                    d                    }t          j        |                    d                    }t          j        |                    d                    }|rd| _        |rd}d}||||d| _        dS )z
        Set properties for the chart drop lines.

        Args:
            options: A dictionary of options.

        Returns:
            Nothing.

        Nri   rk   rl   rm   ri   rk   rl   rm   )r   r   r   r   r   r   rk   rF   r[   r\   ri   rk   rl   rm   s         r^   set_drop_lineszChart.set_drop_lines+  s     ?G)'++f*=*=>>)'++f*=*=>> /I0F0FGG 1'++j2I2IJJ  	DI  	GD  	
 
r_   c                 |   |i }t          j        |                    d                    }t          j        |                    d                    }t          j        |                    d                    }t          j        |                    d                    }|rd| _        |rd}d}||||d| _        dS )z
        Set properties for the chart high-low lines.

        Args:
            options: A dictionary of options.

        Returns:
            Nothing.

        Nri   rk   rl   rm   r   )r   r   r   r   r   r   rk   rG   r   s         r^   set_high_low_lineszChart.set_high_low_linesR  s     ?G)'++f*=*=>>)'++f*=*=>> /I0F0FGG 1'++j2I2IJJ  	DI  	GD  	
 
r_   c                     |dS || _         dS )z
        Create a combination chart with a secondary chart.

        Args:
            chart: The secondary chart to combine with the primary chart.

        Returns:
            Nothing.

        N)rW   )r[   charts     r^   combinezChart.combiney  s     =Fr_   c                    |                                   |                                  |                                  |                                  |                                  |                                  |                     | j                   | j        r| 	                                 | 
                    d           |                                  d S )Nc:chartSpace)_xml_declaration_write_chart_space_write_lang_write_style_write_protection_write_chart_write_sp_prr.   r   _write_print_settings_xml_end_tag
_xml_closer   s    r^   _assemble_xml_filezChart._assemble_xml_file  s     	 	!!! 	 	 	    	 	$.))) = 	)&&((( 	.)))r_   c                    |d                                          }|                    |           |                     |                    d          |                    d                    \  }}|                     ||                    d                    }i d|d         d|d|d|d|                    d          d|                    d          d	|                    d	          d
|                    d
          d|                    d          d|                    d          d|                    d          d|                    d          d|                    d          d|                    d          d|                    d          d|                    d          d|                    d          |                    d          |                    d          |                    d          |                    d          |                    d          dd}d|v r|                    d          |d<   nd|d<   |                     |d                   |d<   |                    dd          |d<   |                    d          r,|d         d         r|                     |d                   |d<   |                    d           r,|d          d         r|                     |d                    |d <   |                    d          r#|d                                         d!         |d<   |                    d          r$|d         d"k    rd#|d<   n|d         d$k    rnd |d<   |                    d%          rd| _        |                    d&          rd| _        d|d&<   |                    d          r9t          |d                   r$t          |d         | j        | j                  |d<   |                    d	          r9t          |d	                   r$t          |d	         | j        | j                  |d	<   |                    d          r9t          |d                   r$t          |d         | j        | j                  |d<   |                     |                    d'                    |d'<   |                     |                    d(                    |d(<   |                     |                    d)          d          |d)<   t          j        |                    d*                    |d*<   t          j        |                    d+                    |d+<   t          j        |                    d,                    |d,<   t          j        |                    d-                    |d-<   |                    d,          rd |d+<   |                    d-          r
d |d,<   d |d+<   |                     |                    d.                    |d.<   |                     |                    d/                    |d/<   |S )0Ndefaultsrd   re   r   formular   reverseminmax
minor_unit
major_unitminor_unit_typemajor_unit_typedisplay_unitslog_basecrossingposition_axispositionlabel_positionlabel_align
num_formatnum_format_linkedinterval_unitinterval_tickF)r   r   r   r   r   	text_axisvisibler   display_units_visibleTmajor_gridlinesminor_gridlinesr   on_tickmidCatr   	date_axisr   num_fontr   name_layoutri   rk   rl   rm   minor_tick_markmajor_tick_mark)copyupdater   r   r   _get_display_units_get_gridline_propertieslowerrQ   r   r   rR   rS   r   r   r   r   r   r   r   _get_tick_type)r[   r   user_optionsr\   rd   re   r   s          r^   r   zChart._convert_axis_args  s   z"''))|$$$!00KK^!<!<
 
l ##L'++f2E2EFF
Z(
D
 |
 w	

 w{{9--
 7;;u%%
 7;;u%%
 '++l33
 '++l33
 w{{+<==
 w{{+<==
 W[[99
 J//
 J//
 W[[99
  J//!
" gkk*:;;#
$ #;;}55!++l33!(-@!A!A$[[99$[[99/
 
 
4 %kk)44DOODO !% 7 7_8M N N_(/4KT(R(R$% ;;()) 	g6G.H.S 	&*&C&C)*' 'D"#
 ;;()) 	g6G.H.S 	&*&C&C)*' 'D"#
 88J 	;#J/5577:D 88O$$ 	-O$	11(0_%%o&)33 )-_% ;;{## 	&!%D ;;{## 	%!&D $D 88E?? 	1$u+>> 	4UT^T-A DK 88E?? 	1$u+>> 	4UT^T-A DK 88J 	$6tJ7G$H$H 	9Z $.$2F   D
  227;;z3J3JKKZ 33GKK4L4LMM[ #99KK&&
 
]
 1'++f2E2EFFV 1'++f2E2EFFV  7I8N8NOOY !9'++j:Q:QRRZ 88I 	 DL 88J 	 "DODL #'"5"5gkkBS6T6T"U"U"&"5"5gkkBS6T6T"U"Ur_   c                 2   |sd S |                     d          |                     d          |                     d          |                     d          |                     d          |                     d          |                     d          |                     d          |                     d	d
          |                     d          d
}|d         rt          |d         dz            |d<   |d         rdt          |d                   z  |d<   |S )Nrd   colorsizebolditalic	underlinepitch_familycharsetbaseliner   rotation)
rd   r  r  r  r  r  r  r  r  r  d   `  )r   int)r[   r\   r   s      r^   r   zChart._convert_font_args4  s    	F KK''[[))KK''KK''kk(++ [11#KK77{{9--J22J//
 
 < 	3tF|c122DL 
 	=$s4
+;'<'<<Dr_   c                     t          |t                    s%|r!d|v rd|vr| j        rt          d|z             |S t	          | }|S )N 'zSSheetname in '%s' contains spaces but isn't quoted. This may cause errors in Excel.)
isinstancelistrY   r   r
   )r[   r   r   s      r^   r   zChart._list_to_formulaP  sj     $%% 	 t4D<O68<=   K"D)r_   c                     |jt          |t                    r<t          |d         |d         dd          }t          |d                   dz   |z   }d}nt	          j        d|          r|}d}||fS )Nr   r   Tr   !r   ^=?[^!]+!\$?[A-Z]+\$?\d+)r  r  r	   r   rematch)r[   rd   re   cells       r^   r   zChart._process_namesa  s     $%% (a$q'4FF.tAw77#=D5t<< #\!!r_   c                    |t          |          dk    rdS t          |d         t                    rdS |D ]T}|t          |t                    rt	          j        d|          r dS 	 t          |           C# t          $ r Y  dS w xY wdS )Nr   r   	multi_strz[_ ]strnum)r   r  r  r(  r#  searchfloat
ValueError)r[   r   tokens      r^   _get_data_typezChart._get_data_typeq  s     <3t99>>6d1gt$$ 	;  	 	E} %%% ")FE*B*B uue   uuu
 us   *A::
B	B	c                 .   |sd S |                     d          r|                    d          }|| j        vr9t          | j                  }| j                            |           || j        |<   n$| j        |         }| j        |         
|| j        |<   |S )N=)
startswithlstripr)   r   r*   r   )r[   r   r   
formula_ids       r^   r   zChart._get_data_id  s      	F c"" 	*nnS))G $***T.//J$$T***(2DW%% )'2J  ,404!*-r_   c                    |sd S t          j        |          }dddddddddd	d	d
ddd}|                    d          }|$||v r||         |d<   nt          d|z             d S t	          j        |                    d                    }d|v rt	          j        |d                   }t	          j        |                    d                    }t	          j        |                    d                    }t	          j        |                    d                    }|rd | _	        |rd }d }||d<   ||d<   ||d<   ||d<   |S )N	automaticr   squarediamondtrianglexstardotdashcirclepluspicture)r5  r   r6  r7  r8  r9  r:  r;  
short_dashr<  	long_dashr=  r>  r?  typezUnknown marker type '%sri   rj   rk   rl   rm   )
r  deepcopyr   r   r   r   r   r   r   rk   )r[   rn   typesmarker_typeri   rk   rl   rm   s           r^   r   zChart._get_marker_properties  s     	F v&& % " 
 
$ jj(("e##!&{!3v.<=== )&**V*<*<== v-fX.>??D )&**V*<*<== /

90E0EFF 1&**Z2H2HII  	DI  	GDvv#y%zr_   c                    |sd S t          j        |          }ddddddd}|                    d          }||v r||         |d<   nt          d	|z             d S t	          j        |                    d
                    }d|v rt	          j        |d                   }t	          j        |                    d                    }t	          j        |                    d                    }t	          j        |                    d                    }| 	                    |                    d                    }|rd | _
        |rd }d }||d
<   ||d<   ||d<   ||d<   ||d<   |S )Nexplinearlog	movingAvgpolypower)exponentialrH  rI  moving_average
polynomialrL  rB  zUnknown trendline type '%s'ri   rj   rk   rl   rm   label)r  rC  r   r   r   r   r   r   r   _get_trendline_label_propertiesrk   )	r[   ro   rD  
trend_typeri   rk   rl   rm   rP  s	            r^   r   zChart._get_trendline_properties  s     	F M),,	 !) 
 
 ]]6**
 %j 1If.;<<<F ))--*?*?@@ y  -i.ABBD ))--*?*?@@ /	i0H0HII 1)--
2K2KLL 44Y]]75K5KLL  	DI  	GD 	& 	&&	) (	*"	'r_   c                 J   |si S t          j        |          }|                     |                    d                    }t	          j        |                    d                    }d|v rt	          j        |d                   }t	          j        |                    d                    }t	          j        |                    d                    }t	          j        |                    d                    }|rd | _	        |rd }d }||d<   ||d<   ||d<   ||d<   ||d<   |S )Nr   ri   rj   rk   rl   rm   )
r  rC  r   r   r   r   r   r   r   rk   )r[   rP  r   ri   rk   rl   rm   s          r^   rQ  z%Chart._get_trendline_label_properties4  s5     	I e$$ &&uyy'8'899 )%))F*;*;<< u-eHo>>D )%))F*;*;<< /		)0D0DEE 1%))J2G2GHH  	DI  	GDfff"i$jr_   c                 &   |sd S ddddd}dddddd	}|d
         }||v r||         |d
<   nt          d|z             d S d|v r|d         |d<   d|v r|d         |d<   d|v r%|d         dk    rd|d<   n|d         dk    rd|d<   n	 |                    d          |d<   |                    d          |d<   |                    d          |d<   |                    d          |d<   t          j        |                    d                    |d<   |S )NfixedValr   both)rB  valueendcap	direction
percentagestdDevstdErrcust)fixedrZ  standard_deviationstandard_errorcustomrB  zUnknown error bars type '%srW  	end_stylerX  rY  minusr>  plus_valuesminus_values	plus_data
minus_datari   )r   r   r   r   )r[   r\   r~   rD  
error_types        r^   r   zChart._get_error_bars_propsa  s    	F )1PVWW
  &"*&
 
 V_
!&z!2Jv.;<<<F g")'"2Jw '!!#*;#7Jx  '!!{#w..*1
;''%//*0
;''  %,KK$>$>
=!%,[[%@%@
>"")++k":":
;#*;;|#<#<
<  #7F8K8KLL
6r_   c                     d|                     d          i}t          j        |                     d                    |d<   |S )Nr   ri   )r   r   r   )r[   r\   gridlines      r^   r
  zChart._get_gridline_properties  sB     w{{9556 !5gkk&6I6IJJr_   c                 .   |sd S t          j        |          }|                    d          }|r?|| j        v r"|| j        k    rd |d<   n%| j        |         |d<   nt          d|z             d S |                    d          }dddddd	}|r!||v r||         |d<   nt          d
           d S |                     |                    d                    |d<   t          j        |                    d                    }d|v rt          j        |d                   }t          j	        |                    d                    }t          j
        |                    d                    }t          j        |                    d                    }|rd | _        |rd }d }||d<   ||d<   ||d<   ||d<   |                    d          r|d         D ]}	|	|	                    d          }
|
r't          j        dt          |
                    r|
|	d<   |	                    d          }|r-|                    d          r|                    d          |	d<   |                     ||	                    d                    }||	d<   |                     |	                    d                    |	d<   t          j        |	                    d                    }d|	v rt          j        |	d                   }t          j	        |	                    d                    }t          j
        |	                    d                    }t          j        |	                    d                    }|rd | _        |rd }d }||	d<   ||	d<   ||	d<   ||	d<   |S )Nr   z3Unsupported label position '%s' for this chart type	separatorz, z; z. 
r  ),;.rm  r  zUnsupported label separatorr   ri   rj   rk   rl   rm   ra  rW  r"  r   r0  r   r   )r  rC  r   rT   rU   r   r   r   r   r   r   r   rk   r#  r$  r(  r1  r2  r   )r[   r{   r   rl  
separatorsri   rk   rl   rm   rP  rW  r   r   s                r^   r   zChart._get_labels_properties  s     	4 v&& ::j)) 	4///t:::)-F:&&)-)=h)GF:&&JXUVVV JJ{++	
 

  	J&&&0&;{##2333 00F1C1CDDv )&**V*<*<== v-fX.>??D )&**V*<*<== /

90E0EFF 1&**Z2H2HII  	DI  	GDvv#y%z::h .	-) -- --=		'** -RX&A3u::NN -',E)$))I.. ;w11#66 ;'.~~c':':E)$++GUYYv5F5FGG#*i  $ 7 7		&8I8I J Jf 1%))F2C2CDD u$$ 5eHoFFD 1%))F2C2CDD  7		)8L8LMM !9%))J:O:OPP  % $DI   "GD $f $f#*i $,j!!r_   c                 B   i }t          j        |                    d                    }|                    d          rt          j        |d                   }t          j        |                    d                    }t          j        |                    d                    }t          j        |                    d                    }|rd | _        |rd }d }|                     |                    d          d          }||d<   ||d<   ||d<   ||d<   ||d<   |S )Nri   rj   rk   rl   rm   r   F)r   r   r   r   r   r   rk   r   )r[   r\   areari   rk   rl   rm   r   s           r^   r   zChart._get_area_properties  s&    )'++f*=*=>> ;;x   	A-gh.?@@D )'++f*=*=>> /I0F0FGG 1'++j2I2IJJ  	DI  	GD ,,W[[-B-BEJJVV!YX#Zr_   c                    i }|i }|                     dd          |d<   |                     d          |d<   |                     |                     d                    |d<   |                     |                     d          d          |d<   |                     d          rd|d<   t          j        |                     d                    }|                     d	          rt          j        |d	                   }t          j        |                     d
                    }t          j        |                     d                    }t          j        |                     d                    }|rd | _        |rd }d }|                     |                     d          d          }||d<   ||d
<   ||d<   ||d<   ||d<   |S )Nr   rightdelete_seriesr   r   Fr   ri   rj   rk   rl   rm   )	r   r   r   r   r   r   r   r   rk   )r[   r\   r&   ri   rk   rl   rm   r   s           r^   r   zChart._get_legend_propertiesD  s   ?G$[[W==z")++o">">00V1D1DEEv66w{{87L7LeTTx ;;v 	(!'F: )'++f*=*=>> ;;x   	A-gh.?@@D )'++f*=*=>> /I0F0FGG 1'++j2I2IJJ  	DI  	GD ,,W[[-B-BEJJvv#y!x%zr_   c           	         i }|sd S |rd}nd}|                                 D ]}||vrt          d|z              d S |D ]}||                                 vrt          d|z              d S ||         }	 t          |           n(# t          $ r t          d|d|d           Y  d S w xY w|dk     s|d	k    rt          d|d|d
            d S d|z  ||<   |S )N)r9  y)r9  rx  r9   r:   z+Property '%s' allowed not in layout optionsz1Property '%s' must be specified in layout optionsz
Property 'z	' value 'z' must be numeric in layoutr   r   z/' must be in range 0 < x <= 1 in layout optionsz%.17g)keysr   r+  r,  )r[   argsis_textr   
propertieskeyproprW  s           r^   r   zChart._get_layout_propertiesx  sl    	F 	7#JJ6J 99;; 	 	C*$$BSHIII %
  	+ 	+D499;;&&H4OPPPJEe   LPDDRWRWRWX   	 qyyEAII6:ddEEEC    #U?F4LLs   6B B+*B+c                    g }|sd S |D ]}i }|t          j        |                    d                    }d|v rt          j        |d                   }t          j        |                    d                    }t          j        |                    d                    }t          j        |                    d                    }|rd | _        |rd }d }||d<   ||d<   ||d<   ||d<   |                    |           |S )Nri   rj   rk   rl   rm   )r   r   r   r   r   r   rk   r   )	r[   user_pointsrs   
user_pointpointri   rk   rl   rm   s	            r^   r   zChart._get_points_properties  s+    	F% "	! "	!JE%1*..2H2HII z)) 5j6JKKD 1*..2H2HII  7
y8Q8QRR !9*..:T:TUU  % $DI   "GD $f $f#*i $,j!MM%    r_   c                 
   d}d}|                     d          }|                     d          }|                     d          r|d         d         rd}|                     d          r|d         d         rd}|s|s|s|sdS dS )NFrl   rm   rk   definedTri   )r   )r[   elementhas_fillhas_linehas_patternhas_gradients         r^   _has_fill_formattingzChart._has_fill_formatting  s    kk),,{{:..;;v 	76?9#= 	H;;v 	76?9#= 	H 	 	 	\ 	54r_   c           
      h    |sd S ddddddddd	d
	}||v r	||         }nt          d|z             d S |S )Nhundreds	thousandstenThousandshundredThousandsmillionstenMillionshundredMillionsbillions	trillions)	r  r  ten_thousandshundred_thousandsr  ten_millionshundred_millionsr  r  zUnknown display_units type '%s'r   )r[   r   rD  s      r^   r	  zChart._get_display_units  sp     	F #$+!3") 1"$

 

 E!!!-0MM2]BCCCFr_   c                 ^    |sd S ddddd}||v r	||         }nt          d|z             d S |S )Noutinr   cross)outsideinsider   r  zUnknown tick_type  '%s'r   )r[   	tick_typerD  s      r^   r  zChart._get_tick_type  sa     	F 	
 
 i(II*Y6777Fr_   c                 X    g }| j         D ]}|d         s|                    |            |S Nr2   r   r   )r[   primary_axes_seriesr   s      r^   _get_primary_axes_serieszChart._get_primary_axes_series  sA     k 	3 	3F)$ 3#**6222""r_   c                 X    g }| j         D ]}|d         r|                    |            |S r  r  )r[   secondary_axes_seriesr   s      r^   _get_secondary_axes_seriesz Chart._get_secondary_axes_series  sA     "k 	5 	5Fi  5%,,V444$$r_   c                    dt          | j                  z   }dt          | j                  z   t          | j                  z   }d||fz  }d||dz   fz  }|d         r4| j                            |           | j                            |           |d         s6| j                            |           | j                            |           d S d S )Ni  r   z%04d%04dprimary_axes)r  r   r   r#   r"   r   )r[   rz  chart_id
axis_countid1id2s         r^   _add_axis_idszChart._add_axis_ids&  s    #dg,,&T^,,,s4=/A/AA
Hj11Hj1n55 	&M  %%%M  %%%N# 	'N!!#&&&N!!#&&&&&	' 	'r_   c                 *   dddid| j         d<   dddid| j        d<   ddddd	| j        d<   dddid
dd| j        d<   |                     i            |                     i            |                     i            |                     i            d S )NGeneralr   r   )r   r   r   r   r   r   )r   r   r   r   ru  )r   r   r   r   )r0   r1   r3   r2   r   r   r   r   r   s    r^   rZ   zChart._set_default_properties6  s     $ )1~#
 #
J $ )1~#
 #
J $$	$
 $
Z  $ )1~	$
 $
Z  	r_   c                 j    d}|dz   }|dz   }|dz   }d|fd|fd|fg}|                      d|           d S )	Nz"http://schemas.openxmlformats.org/zdrawingml/2006/chartzdrawingml/2006/mainz!officeDocument/2006/relationshipszxmlns:czxmlns:azxmlns:rr   )_xml_start_tag)r[   schemaxmlns_cxmlns_axmlns_r
attributess         r^   r   zChart._write_chart_space]  sg    51100>>    

 	NJ77777r_   c                 @    d}d|fg}|                      d|           d S )Nen-USvalzc:lang_xml_empty_tagr[   r  r  s      r^   r   zChart._write_langl  s.    cl^
Hj11111r_   c                 Z    | j         }|dk    rd S d|fg}|                     d|           d S )Nr   r  zc:style)r!   r  )r[   r!   r  s      r^   r   zChart._write_stylet  sB    = q==Fh'(
Iz22222r_   c                 F   |                      d           | j        r|                                  no| j        4|                     | j        | j        d | j        | j        | j                   n4| j	        -| 
                    | j	        d | j        | j        | j                   |                                  |                                  |                                  |                                  | j        r|                                  |                     d           d S )Nzc:chart)r  rP   _write_c_auto_title_deletedrL   _write_title_formularM   rJ   rN   rO   rK   _write_title_rich_write_plot_area_write_legend_write_plot_vis_only_write_disp_blanks_asr6   _write_c_ext_lst_display_nar   r   s    r^   r   zChart._write_chart  sA   I&&&? 	,,.... !-))&&O%&    ,&&OO%&   	 	 	!!### 	""$$$   	/,,...)$$$$$r_   c                 Z    | j         }|dk    rd S d|fg}|                     d|           d S )Nr   r  zc:dispBlanksAs)r5   r  r  s      r^   r  zChart._write_disp_blanks_as  sB     %<<Fcl^
,j99999r_   c                 (   |                      d           |                     | j                            d          d           |                     ddi           |                     ddi           | j        }|ri|j        rd| j        z   |_        n| j        |_        | j        |_        | j	        |_	        |                    ddi           |                    ddi           | j
        | j        | j        d}| j        r|                     |           n|                     |           |                     |           | j        | j        | j        d}|                     |           |r1|j        r*|j        |j        |j        d}|                    |           | j        r|                     |           n|                     |           |                                  |                     | j                   |                     d           d S )	Nz
c:plotArear   plotr  TF  )r0   r1   r"   )r  _write_layoutr/   r   _write_chart_typerW   rX   r   fhr    r0   r1   r"   rQ   _write_date_axis_write_cat_axis_write_val_axisr3   r2   r#   _write_d_tabler   r   )r[   second_chartrz  s      r^   r  zChart._write_plot_area  sK   L))) 	4=,,X66??? 	56666777 } 	D( *"&."&' #gLO )-(9L% **ND+ABBB**NE+BCCC +$-XX 	'!!$''''  &&&T""" ll
 
 	T"""  	/L5 	/&.&.(2 D ((... 	'!!$''''  &&& 	 	$-(((,'''''r_   c                     |s|                      d           d S |                     d           |                     ||           |                     d           d S )Nc:layout)r  r  _write_manual_layoutr   r[   r   layout_types      r^   r  zChart._write_layout  sl      	*
+++++ 
+++%%fk:::j)))))r_   c                    |                      d           |dk    r|                     ddg           |                     ddg           |                     ddg           |                     dd	|d
         fg           |                     dd	|d         fg           |dk    r>|                     dd	|d         fg           |                     dd	|d         fg           |                     d           d S )Nzc:manualLayoutr  zc:layoutTarget)r  innerzc:xMode)r  edgezc:yModezc:xr  r9  zc:yrx  textzc:wr9   zc:hr:   r  r  r   r  s      r^   r  zChart._write_manual_layout  s$   ,--- &   03C2DEEE 	I'8999I'8999EUF3K$8#9:::EUF3K$8#9::: &  w(@'ABBBx0@(A'BCCC*+++++r_   c                     d S N r   s     r^   r  zChart._write_chart_type"  s	     	r_   c                 <    d|fg}|                      d|           d S )Nr  z
c:groupingr  r  s      r^   _write_groupingzChart._write_grouping'  s)    cl^
L*55555r_   c                 0    |                      |           d S r  )
_write_serr[   r   s     r^   _write_serieszChart._write_series-  s    r_   c                 l   | j         }| xj         dz  c_         |                     d           |                     |           |                     |           |                     |           |                     |           |                     |d                    |                     |d                    |                     |d                    | 	                    |d                    | 
                    |d                    |                     |d                    |                     |           |                     |           | j        r|                     |d	                    |                    d
          r|                     |d
                    |                     d           d S )Nr   zc:serrn   r|   rs   r{   ro   r~   rp   r}   )r    r  
_write_idx_write_order_write_series_namer   _write_marker_write_c_invert_if_negative_write_d_pt_write_d_lbls_write_trendline_write_error_bars
_write_cat
_write_valrI   _write_c_smoothr   _write_c_ext_lst_inverted_colorr   )r[   r   indexs      r^   r  zChart._write_ser1  s   !QG$$$ 	 	%    	''' 	&!!! 	6(+,,, 	(()@AAA 	)*** 	6(+,,, 	f[1222 	vl3444 	 	  	3  !1222 ::&'' 	K008H1IJJJ'"""""r_   c                    d}d}d|fd|fg}d|fg}|                      d           |                      d|           |                      d           |                      d|           |                     d	|i           |                     d           |                     d           |                     d           |                     d           d S )
Nz&{6F2FDCE9-48DA-4B69-8628-5D25D57E5C99}z:http://schemas.microsoft.com/office/drawing/2007/8/2/charturiz	xmlns:c14c:extLstc:extzc14:invertSolidFillFmtzc14:spPrr  )r  _write_a_solid_fillr   )r[   r  r  
xmlns_c_14attributes1attributes2s         r^   r  z%Chart._write_c_ext_lst_inverted_colorf  s     7Q
 CL*%

 $Z01J'''G[1114555J444  '5!1222*%%%2333'"""*%%%%%r_   c                 N   d}d}d|fd|fg}dg}|                      d           |                      d|           |                      d           |                     d	|           |                     d           |                     d           |                     d           d S )
Nz&{56B9EC1D-385E-4148-901F-78D8002777C0}z9http://schemas.microsoft.com/office/drawing/2017/03/chartr  zxmlns:c16r3r  r   r  r  zc16r3:dataDisplayOptions16zc16r3:dispNaAsBlankr  )r[   r  
xmlns_c_16r  r  s        r^   r  z!Chart._write_c_ext_lst_display_na  s     7P
 CLJ'

 "lJ'''G[11189991;???6777'"""*%%%%%r_   c                 <    d|fg}|                      d|           d S )Nr  zc:idxr  r  s      r^   r  zChart._write_idx  +     cl^
GZ00000r_   c                 <    d|fg}|                      d|           d S )Nr  c:orderr  r  s      r^   r  zChart._write_order  s+     cl^
Iz22222r_   c                     |d         $|                      |d         |d                    d S |d         |                     |d                    d S d S )Nre   rx   rd   )_write_tx_formula_write_tx_valuer  s     r^   r  zChart._write_series_name  se     .!-""6.#96);LMMMMMF^'  00000 ('r_   c                 <    |r|                      ddg           d S d S )Nzc:smooth)r  1r  )r[   rp   s     r^   r  zChart._write_c_smooth  s4      	<
\N;;;;;	< 	<r_   c                    |d         }|d         }d }|| j         |         }|sd S |                     d           |                     |          }|dk    rd| _        |                     |||           nB|dk    rd| _        |                     ||           nd| _        |                     |||           |                     d           d S )Nrb   rz   zc:catr(  r   r'  r   )r*   r  r.  r$   _write_str_ref_write_multi_lvl_str_ref_write_num_refr   )r[   r   r   r   r   cat_types         r^   r  zChart._write_cat  s    &'$W-D  	FG$$$ &&t,,u#$D x8888$$#$D ))'48888 $%D x888'"""""r_   c                     |d         }|d         }| j         |         }|                     d           |                     ||d           |                     d           d S )Nra   ry   c:valr)  )r*   r  r  r   )r[   r   r   r   r   s        r^   r  zChart._write_val  sk    "' )G$$$ 	GT5111'"""""r_   c                     |                      d           |                     |           |dk    r|                     |           n|dk    r|                     |           |                     d           d S )Nzc:numRefr)  r(  r  _write_series_formula_write_num_cache_write_str_cacher   r[   r   r   ref_types       r^   r  zChart._write_num_ref  s    J''' 	""7+++u!!$''''!!$'''*%%%%%r_   c                     |                      d           |                     |           |dk    r|                     |           n|dk    r|                     |           |                     d           d S )Nzc:strRefr)  r(  r  r  s       r^   r  zChart._write_str_ref  s     	J''' 	""7+++u!!$''''!!$'''*%%%%%r_   c                    |sd S |                      d           |                     |           |                      d           t          |d                   }|                     |           t	          |          D ]]}|                      d           t          |          D ]!\  }}|                     |||                    "|                     d           ^|                     d           |                     d           d S )Nzc:multiLvlStrRefzc:multiLvlStrCacher   zc:lvl)r  r  r   _write_pt_countreversed	enumerate	_write_ptr   )r[   r   r   countcat_datair  s          r^   r  zChart._write_multi_lvl_str_ref  s     	F./// 	""7+++0111 DHU###  	' 	'H(((%h// / /5q(1+....g&&&&.///,-----r_   c                     |                     d          r|                    d          }|                     d|           d S )Nr0  zc:f)r1  r2  _xml_data_element)r[   r   s     r^   r  zChart._write_series_formula  sG     c"" 	*nnS))Gug.....r_   c                 D   |                      |           |d         rB|                     | j        d                    |                     | j        d                    d S |                     | j        d                    |                     | j        d                    d S )Nr  r   r   )r  _write_axis_idr"   r#   )r[   rz  s     r^   _write_axis_idszChart._write_axis_ids(  s     	4    	3a 0111a 011111 q 1222q 122222r_   c                 <    d|fg}|                      d|           d S )Nr  zc:axIdr  r  s      r^   r$  zChart._write_axis_id7  +     cl^
Hj11111r_   c                 6   |d         }|d         }|d         }|t          |          sd S | j        }| j        }|                    d          r|d         }|                     d           |                     |d                    |                     |                    d          d d d            |                    d          s|                     d	           |                     ||                    d                     | 	                    |                    d
                     | 
                    |                    d                     |d         2|                     |d         |d         ||d         |d                    n2|d         *|                     |d         ||d         |d                    |                     |           |                     |                    d                     |                     |                    d                     |                     |                    d                     |                     |           |                     |                    d                     |                     |d	                    | j        s|                    d          r|                    d          %|                    d          dk    s|d         dk    r)|                     |                    d                     n(|                     |                    d                     |                    d          s|                     d	           |                     |                    d                     |                     d           |                     |                    d                     |                     |                    d                     |                     d           d S )Nr0   r1   r"   r   zc:catAxr   r   r   r   r   r   r   r   r   r  rd   r  r  r   r  r   r   r   r   r   r  r   r   )r   r'   r+   r   r  r$  _write_scaling_write_delete_write_axis_pos_write_major_gridlines_write_minor_gridlinesr  r  _write_cat_number_format_write_major_tick_mark_write_minor_tick_mark_write_tick_label_posr   _write_axis_font_write_cross_axisr8   _write_crosses_write_c_crosses_at_write_auto_write_label_align_write_label_offset_write_c_tick_lbl_skip_write_c_tick_mark_skipr   r[   rz  r0   r1   r"   r   	is_y_axiss          r^   r  zChart._write_cat_axis>  s   hh
# 3x==F)'	 ::j!! 	*j)HI&&&HQK((( 	FJJy114tDDDzz)$$ 	"q!!! 	Xvzz)'<'<=== 	##FJJ/@$A$ABBB 	##FJJ/@$A$ABBB )(%%y!y!{#}%    F^'""v	6++>}@U  
 	%%f--- 	##FJJ/@$A$ABBB 	##FJJ/@$A$ABBB 	""6::.>#?#?@@@ 	&!!! 	fjj44555 	x{+++ 	A

9 5 5 	A 

:&&.::j))U22*%.. ##FJJz$:$:;;;; ((J)?)?@@@ zz+&& 	 Q 	

= 9 9::: 	  %%% 	##FJJ$?$?@@@ 	$$VZZ%@%@AAA)$$$$$r_   c                    |d         }|d         }|d         }|                     d| j                  }| j        }|t          |          sd S |                     d          p|}|                     d           |                     |d                    |                     |                     d          |                     d          |                     d	          |                     d
                     |                     d          s|                     d           |                     ||                     d                     | 	                    |                     d                     | 
                    |                     d                     |d         2|                     |d         |d         ||d         |d                    nL|d         D|                     |d         ||                     d          |                     d                     |                     |           |                     |                     d                     |                     |                     d                     |                     |                     d                     |                     |           |                     |                     d                     |                     |d                    |                     d          |d         d	k    s|d         dk    r)|                     |                     d                     n(|                     |                     d                     |                     |                     d                     |                     |                     d                     |                     |                     d                     |                     |                     d          |                     d                     |                     d           d S )Nr0   r1   r"   r   c:valAxr   r   r   r   r   r   r   r   r   r   r   r  rd   r  r  r   r  r   r   r   r   r   r   r   )r   r(   r,   r   r  r$  r)  r*  r+  r,  r-  r  r  _write_number_formatr/  r0  r1  r   r2  r3  r4  r5  _write_cross_between_write_c_major_unit_write_c_minor_unit_write_disp_unitsr   r;  s          r^   r  zChart._write_val_axis  s!   hh
#88J(>??'	 3x==F ::j))5XI&&&HQK((( 	JJy!!JJuJJuJJz""		
 	
 	
 zz)$$ 	"q!!! 	Xvzz)'<'<=== 	##FJJ/@$A$ABBB 	##FJJ/@$A$ABBB )(%%y!y!{#}%    F^'""v

;''

=))	   	!!&))) 	##FJJ/@$A$ABBB 	##FJJ/@$A$ABBB 	""6::.>#?#?@@@ 	&!!! 	fjj44555 	x{+++ JJz""*j!U**j!U** 

: 6 67777 $$VZZ
%;%;<<< 	!!&**_"="=>>> 	  L!9!9::: 	  L!9!9::: 	JJ''4K)L)L	
 	
 	
 	)$$$$$r_   c                 T   |d         }|d         }|d         }|d         p| j         }| j        }|t          |          sd S |                    d          p|}|                     d           |                     |d                    |                     |                    d          |                    d          |                    d	          |                    d
                     |                    d          s|                     d           |                     ||                    d                     | 	                    |                    d                     | 
                    |                    d                     |d         2|                     |d         |d         ||d         |d                    n2|d         *|                     |d         ||d         |d                    |                     |           |                     |                    d                     |                     |                    d                     |                     |                    d                     |                     |           |                     |                    d                     |                     |d                    |                    d          |d         d	k    s|d         dk    r)|                     |                    d                     n(|                     |                    d                     |                     |                    d                     |                     |                    d                     |                     |                    d                     |                     |                    d          |                    d                     |                     d           d S )Nr0   r1   r"   r   r>  r   r   r   r   r   r   r   r   r   r   r   r   r  rd   r  r  r   r  r   r   r   r   r   r   )r(   r,   r   r   r  r$  r)  r*  r+  r,  r-  r  r  r?  r/  r0  r1  r   r2  r3  r4  r5  r@  rA  rB  rC  r   r;  s          r^   _write_cat_val_axiszChart._write_cat_val_axis	  s    hh
#
#=t'='	 3x==F ::j))5XI&&&HQK((( 	JJy!!JJuJJuJJz""		
 	
 	
 zz)$$ 	"q!!! 	Xvzz)'<'<=== 	##FJJ/@$A$ABBB 	##FJJ/@$A$ABBB )(%%y!y!{#}%    F^'""v	6++>}@U  
 	!!&))) 	##FJJ/@$A$ABBB 	##FJJ/@$A$ABBB 	""6::.>#?#?@@@ 	&!!! 	fjj44555 	x{+++ JJz""*j!U**j!U** 

: 6 67777 $$VZZ
%;%;<<< 	!!&**_"="=>>> 	  L!9!9::: 	  L!9!9::: 	JJ''4K)L)L	
 	
 	
 	)$$$$$r_   c                 t	   |d         }|d         }|d         }|t          |          sd S | j        }|                    d          p|}|                     d           |                     |d                    |                     |                    d          |                    d          |                    d	          |                    d
                     |                    d          s|                     d           |                     ||                    d                     |                     |                    d                     | 	                    |                    d                     |d         2| 
                    |d         |d         d |d         |d                    n2|d         *|                     |d         d |d         |d                    |                     |           |                     |                    d                     |                     |                    d                     |                     |                    d                     |                     |           |                     |                    d                     |                     |d                    | j        s|                    d          r|                    d          %|                    d          d	k    s|d         dk    r)|                     |                    d                     n(|                     |                    d                     |                     d           |                     d           |                     |                    d                     |                     |                    d                     |                     |                    d                     |                    d          r|                     |d                    |                     |                    d                     |                    d          r|                     |d                    |                     d           d S ) Nr0   r1   r"   r   zc:dateAxr   r   r   r   r   r   r   r   r   r   r   r   r  rd   r  r  r   r  r   r  r   r   r   r   r   r   )r   r'   r   r  r$  r)  r*  r+  r,  r-  r  r  r?  r/  r0  r1  r   r2  r3  r8   r4  r5  r6  r8  r9  r:  rA  _write_c_major_time_unitrB  _write_c_minor_time_unitr   )r[   rz  r0   r1   r"   r   s         r^   r  zChart._write_date_axist	  s   hh
# 3x==F) ::j))5XJ'''HQK((( 	JJy!!JJuJJuJJz""		
 	
 	
 zz)$$ 	"q!!! 	Xvzz)'<'<=== 	##FJJ/@$A$ABBB 	##FJJ/@$A$ABBB )(%%y!y!{#}%    F^'""vf[&96-;P  
 	!!&))) 	##FJJ/@$A$ABBB 	##FJJ/@$A$ABBB 	""6::.>#?#?@@@ 	&!!! 	fjj44555 	x{+++ 	A

9 5 5 	A 

:&&.::j))U22*%.. ##FJJz$:$:;;;; ((J)?)?@@@ 	 	  %%% 	##FJJ$?$?@@@ 	$$VZZ%@%@AAA 	  L!9!9::: ::l## 	E))&1B*CDDD 	  L!9!9::: ::l## 	E))&1B*CDDD*%%%%%r_   c                    |                      d           |                     |           |                     |           |                     |           |                     |           |                     d           d S )Nz	c:scaling)r  _write_c_log_base_write_orientation_write_c_max_write_c_minr   )r[   r   min_valmax_valr   s        r^   r)  zChart._write_scaling	  s     	K((( 	x((( 	((( 	'""" 	'"""+&&&&&r_   c                 D    |sd S d|fg}|                      d|           d S )Nr  z	c:logBaser  r  s      r^   rJ  zChart._write_c_log_base	  8      	Fcl^
K44444r_   c                 H    d}|rd}d|fg}|                      d|           d S )NminMaxmaxMinr  zc:orientationr  )r[   r   r  r  s       r^   rK  zChart._write_orientation
  s;     	Ccl^
OZ88888r_   c                 D    |d S d|fg}|                      d|           d S )Nr  zc:maxr  )r[   rO  r  s      r^   rL  zChart._write_c_max
  7     ?Fg&'
GZ00000r_   c                 D    |d S d|fg}|                      d|           d S )Nr  zc:minr  )r[   rN  r  s      r^   rM  zChart._write_c_min
  rV  r_   c                 `    |r|dk    rd}|dk    rd}d|fg}|                      d|           d S )Nr   rr   tr  zc:axPosr  )r[   r  r   r  s       r^   r+  zChart._write_axis_pos#
  sO      	czzczzcl^
Iz22222r_   c                     |                     d          }d}|||d         d         k    rd}|                     d          rd}d|fd|fg}|                     d|           d S 	Nr   r   r   r   r   
formatCodesourceLinkedc:numFmt)r   r  )r[   r   format_codesource_linkedr  s        r^   r?  zChart._write_number_format0
  s    
 hh|,, "{d:6F|6T'T'TM 88'(( 	M ;']+


 	J
33333r_   c                     |                     d          }d}d}|||d         d         k    rd}d}|                     d          rd}| j        s|rd S d|fd|fg}|                     d|           d S r\  )r   r$   r  )r[   r   r`  ra  default_formatr  s         r^   r.  zChart._write_cat_number_formatG
  s     hh|,, "{d:6F|6T'T'TMN 88'(( 	M # 	 	F ;']+


 	J
33333r_   c                 F    d}d|fd|fg}|                      d|           d S )Nr   r]  r^  r_  r  )r[   r`  ra  r  s       r^   _write_data_label_number_formatz%Chart._write_data_label_number_formatb
  s>     ;']+


 	J
33333r_   c                 D    |sd S d|fg}|                      d|           d S )Nr  zc:majorTickMarkr  r  s      r^   r/  zChart._write_major_tick_markm
  9      	Fcl^
-z:::::r_   c                 D    |sd S d|fg}|                      d|           d S )Nr  zc:minorTickMarkr  r  s      r^   r0  zChart._write_minor_tick_markw
  rg  r_   c                 P    ||dk    rd}d|fg}|                      d|           d S )Nnext_tonextTor  zc:tickLblPosr  r  s      r^   r1  zChart._write_tick_label_pos
  s=    ;#**Ccl^
NJ77777r_   c                 <    d|fg}|                      d|           d S )Nr  z	c:crossAxr  r  s      r^   r3  zChart._write_cross_axis
  +     cl^
K44444r_   c                 D    |d}d|fg}|                      d|           d S )NautoZeror  z	c:crossesr  r  s      r^   r4  zChart._write_crosses
  s3    ;Ccl^
K44444r_   c                 <    d|fg}|                      d|           d S )Nr  zc:crossesAtr  r  s      r^   r5  zChart._write_c_crosses_at
  +     cl^
M:66666r_   c                 <    d|fg}|                      d|           d S )Nr  zc:autor  r  s      r^   r6  zChart._write_auto
  r'  r_   c                 d    |d}|dk    rd}|dk    rd}d|fg}|                      d|           d S )Nctrru  rY  leftr   r  z	c:lblAlgnr  r  s      r^   r7  zChart._write_label_align
  sQ     ;C'>>C&==Ccl^
K44444r_   c                 <    d|fg}|                      d|           d S )Nr  zc:lblOffsetr  r  s      r^   r8  zChart._write_label_offset
  rq  r_   c                 D    |d S d|fg}|                      d|           d S )Nr  zc:tickLblSkipr  r  s      r^   r9  zChart._write_c_tick_lbl_skip
  s3    ;Fcl^
OZ88888r_   c                 D    |d S d|fg}|                      d|           d S )Nr  zc:tickMarkSkipr  r  s      r^   r:  zChart._write_c_tick_mark_skip
  s4    ;Fcl^
,j99999r_   c                     |sd S |d         sd S |d         d         rA|                      d           |                     |           |                     d           d S |                     d           d S )Nr   ri   r  zc:majorGridlinesr  r   r   r  r[   	gridliness     r^   r,  zChart._write_major_gridlines
        	F# 	FVY' 	4 2333 i(((011111 233333r_   c                     |sd S |d         sd S |d         d         rA|                      d           |                     |           |                     d           d S |                     d           d S )Nr   ri   r  zc:minorGridlinesrz  r{  s     r^   r-  zChart._write_minor_gridlines
  r}  r_   c                 N    || j         }d|fg}|                     d|           d S )Nr  zc:crossBetween)r@   r  r  s      r^   r@  zChart._write_cross_between
  s7    ;$Ccl^
,j99999r_   c                 D    |sd S d|fg}|                      d|           d S )Nr  zc:majorUnitr  r  s      r^   rA  zChart._write_c_major_unit   8      	Fcl^
M:66666r_   c                 D    |sd S d|fg}|                      d|           d S )Nr  zc:minorUnitr  r  s      r^   rB  zChart._write_c_minor_unit
  r  r_   c                 D    |d}d|fg}|                      d|           d S )Ndaysr  zc:majorTimeUnitr  r  s      r^   rG  zChart._write_c_major_time_unit  4    ;Ccl^
-z:::::r_   c                 D    |d}d|fg}|                      d|           d S )Nr  r  zc:minorTimeUnitr  r  s      r^   rH  zChart._write_c_minor_time_unit  r  r_   c                     | j         }|                    dd          }|                    d          }g }d}|                    d          r#t          |d         t                    r|d         }|                    d          r|                    dd          }d}d	d
dddd}|dk    rd S ||vrd S ||         }|                     d           |                     |           |D ]}|                     |           | 	                    |                    d          d           |r| 
                                 |r|                     |           |                     |           |                     d           d S )Nr   ru  r   r   rv  overlay_r   r   rY  r   rZ  r   tr)ru  ru  topbottom	top_rightr   zc:legendr   r&   )r&   r   r  r  r1  replacer  _write_legend_pos_write_legend_entryr  _write_overlay_write_tx_prr   r   )r[   r&   r   r   rv  r   allowedr  s           r^   r  zChart._write_legend&  s   ::j'22zz&!!::o&& 	4:f_6Mt+T+T 	4"?3Mz** 	''
B77HG 
 
 vF7""F8$J''' 	x((( # 	, 	,E$$U++++ 	6::h//:::  	"!!! 	$d### 	&!!!*%%%%%r_   c                 <    d|fg}|                      d|           d S )Nr  zc:legendPosr  r  s      r^   r  zChart._write_legend_pos^  rq  r_   c                     |                      d           |                     |           |                     d           |                     d           d S )Nzc:legendEntryr   )r  r  r*  r   )r[   r  s     r^   r  zChart._write_legend_entrye  s\     	O,,, 	 	1/*****r_   c                 @    d}d|fg}|                      d|           d S )Nr   r  z	c:overlayr  r  s      r^   r  zChart._write_overlayr  .    cl^
K44444r_   c                 R    d}| j         rd S d|fg}|                     d|           d S )Nr   r  zc:plotVisOnly)r7   r  r  s      r^   r  zChart._write_plot_vis_onlyz  s@      	Fcl^
OZ88888r_   c                     |                      d           |                                  |                                  |                                  |                     d           d S )Nzc:printSettings)r  _write_header_footer_write_page_margins_write_page_setupr   r   s    r^   r   zChart._write_print_settings  sn    -... 	!!### 	  """ 	   +,,,,,r_   c                 0    |                      d           d S )Nzc:headerFooterr  r   s    r^   r  zChart._write_header_footer  s    ,-----r_   c                 r    d}d}d}d}d}d}d|fd|fd|fd|fd|fd	|fg}|                      d
|           d S )Ng      ?gffffff?g333333?r   r   rY  rZ  headerfooterzc:pageMarginsr  )r[   r  ru  ru  r  r  r  r  s           r^   r  zChart._write_page_margins  ss     &M$K%L#Jvv

 	OZ88888r_   c                 0    |                      d           d S )Nzc:pageSetupr  r   s    r^   r  zChart._write_page_setup  s    M*****r_   c                 4    |                      ddg           d S )Nzc:autoTitleDeletedr  r  r   s    r^   r  z!Chart._write_c_auto_title_deleted  s!    0:,?????r_   Fc                     |                      d           |                     |||           |                     |d           |r|                                  |                     d           d S Nzc:titler  )r  _write_tx_richr  r  r   )r[   titler<  r   r   r   s         r^   r  zChart._write_title_rich  s     	I&&& 	E9d333 	66***  	"!!!)$$$$$r_   c                 
   |                      d           |                     ||           |                     |d           |r|                                  |                     ||           |                     d           d S r  )r  r  r  r  r  r   )r[   r  r   r<  r   r   r   s          r^   r  zChart._write_title_formula  s    
 	I&&& 	ug... 	66***  	"!!! 	$	***)$$$$$r_   c                     |                      d           |                     |||d           |                     d           d S )Nc:txF)ignore_rich_pr)r  _write_richr   )r[   r  r<  r   s       r^   r  zChart._write_tx_rich  sQ     	F### 	iFFF&!!!!!r_   c                     |                      d           |                     |           |                     d           d S )Nr  r  _write_vr   r[   r  s     r^   r  zChart._write_tx_value  sF     	F### 	e&!!!!!r_   c                     d }|| j         |         }|                     d           |                     ||d           |                     d           d S )Nr  r(  )r*   r  r  r   )r[   r  r   r   s       r^   r  zChart._write_tx_formula  sb    $W-DF### 	E4///&!!!!!r_   c                     |r|                     d          	|d         }nd }|                     d           |                     ||           |                                  |                     |||           |                     d           d S )Nr  zc:rich)r   r  _write_a_body_pr_write_a_lst_style_write_a_p_richr   )r[   r  r   r<  r  r  s         r^   r  zChart._write_rich  s      	DHHZ((4J'HHHH%%% 	h	222 	!!! 	UD.999(#####r_   c                 b   g }||rd}||dk    r+|                     d           |                     d           n]|dk    r+|                     d           |                     d           n,|                     d|f           |                     d           |                     d	|           d S )
Ni@i@1 )rotr   )vertwordArtVerti )r  eaVertr  )r  horzza:bodyPr)r   r  )r[   r  r<  r  s       r^   r  zChart._write_a_body_pr  s    
	H8##!!*---!!"9::::X%%!!*---!!"45555!!5("3444!!"2333J
33333r_   c                 0    |                      d           d S )Nz
a:lstStyler  r   s    r^   r  zChart._write_a_lst_style)  s    L)))))r_   c                     |                      d           |s|                     |           |                     ||           |                     d           d S Na:p)r  _write_a_p_pr_rich
_write_a_rr   )r[   r  r   r  s       r^   r  zChart._write_a_p_rich-  sf     	E"""  	*##D))) 	t$$$%     r_   c                     |                      d           |                     |           |                                  |                     d           d S r  )r  r  _write_a_end_para_rprr   r[   r   s     r^   _write_a_p_formulazChart._write_a_p_formula;  s\     	E""" 	%%% 	""$$$%     r_   c                     |                      d           |                     |           |                     d           d S )Nza:pPr)r  _write_a_def_rprr   r  s     r^   r  zChart._write_a_p_pr_richH  sH     	G$$$ 	d###'"""""r_   c                    d}t          j        |          }t          j        |          }|r|                    d          d}|s|rc|                     d|           |r|                     d|d         i           |r|                     |           |                     d           d S |                     d|           d S )Nr   r  r   za:defRPr)	r   _get_font_style_attributes_get_font_latin_attributesr   r  r  _write_a_latinr   r  )r[   r   	has_colorstyle_attributeslatin_attributess        r^   r  zChart._write_a_def_rprR  s    	 ;DAA ;DAA 	DHHW%%1I 	>y 	>
,<=== C(('4=)ABBB 6##$4555j)))))
,<=====r_   c                 @    d}d|fg}|                      d|           d S )Nr  langza:endParaRPrr  )r[   r  r  s      r^   r  zChart._write_a_end_para_rpri  s/    tn%
NJ77777r_   c                     |                      d           |                     |           |                     |           |                     d           d S )Nza:r)r  _write_a_r_pr
_write_a_tr   )r[   r  r   s      r^   r  zChart._write_a_rq  s\     	E""" 	4    	%     r_   c                    d}d}t          j        |          }t          j        |          }|r
|d         d}|                    dd|f           |s|rc|                     d|           |r|                     d|d         i           |r|                     |           |                     d           d S |                     d|           d S )Nr   r  r  r   r  za:rPr)	r   r  r  insertr  r  r  r   r  )r[   r   r  r  r  r  s         r^   r  zChart._write_a_r_pr~  s    	 ;DAA ;DAA 	DM-I 	FD>222 	;y 	;)9::: C(('4=)ABBB 6##$4555g&&&&&)9:::::r_   c                 2    |                      d|           d S )Nza:tr"  r  s     r^   r  zChart._write_a_t  s      	ue,,,,,r_   c                    |r|                     d          	|d         }nd }|                     d           |                     ||           |                                  |                     |           |                     d           d S )Nr  c:txPr)r   r  r  r  r  r   )r[   r   r<  r  s       r^   r  zChart._write_tx_pr  s      	DHHZ((4J'HHHH%%% 	h	222 	!!! 	%%%(#####r_   c                 P   || j         }|sd S |d         dk    rd S |                     d           |                     |d                    |                    d          r|                     |d                    |                     |           |                     d           d S )NrB  r5  zc:markerr  )rA   r  _write_symbolr   _write_marker_sizer   r   )r[   rn   s     r^   r  zChart._write_marker  s    >(F 	F&>[((FJ''' 	6&>*** ::f 	4##F6N333 	&!!!*%%%%%r_   c                 <    d|fg}|                      d|           d S )Nr  zc:sizer  r  s      r^   r  zChart._write_marker_size  r'  r_   c                 <    d|fg}|                      d|           d S )Nr  zc:symbolr  r  s      r^   r  zChart._write_symbol  +     cl^
J
33333r_   c                 ~   |                      |          sd S |                     d           |                    d          rH|d         d         r:d|d         v r|                                  n|                     |d                    |                    d          r|                     |d                    |                    d          r|                     |d                    |                    d          r)|d         d         r|                     |d                    |                     d           d S )Nc:spPrrk   r  r   rl   rm   ri   )	r  r  r   _write_a_no_fillr  _write_a_patt_fill_write_a_grad_fill_write_a_lnr   r  s     r^   r   zChart._write_sp_pr  sI    ((00 	FH%%% ::f 	9&."; 	9''%%'''' ((888::i   	7##F9$5666::j!! 	8##F:$6777 ::f 	-&."; 	-VF^,,,(#####r_   c                 \   g }|                     d          }|2t          |dz   dz            dz  }t          dd|z  z             }d|fg}|                     d          s*|                     d	          s|                     d
          r|                     d|           d|v r|                                  nd	|v r|                     |           |                     d
          }|r|                     |           |                     d           d S |                     d|           d S )Nr9   g      ?   g      @g      ?i1  wr   r  	dash_typeza:ln)r   r  r  r  r  _write_a_prst_dashr   r  )r[   ri   r  r9   	line_types        r^   r  zChart._write_a_ln  sP   
 !!!+,,s2E uu}-..E,J88F 	4txx00 	4DHH[4I4I 	4
333 ~~%%''''D((... --I 3''	222f%%%%%
33333r_   c                 0    |                      d           d S )Nza:noFillr  r   s    r^   r  zChart._write_a_no_fill  s    J'''''r_   c                     |                      d           d|v r@t          |d                   }|                    d          }|                     ||           |                     d           d S )Nza:solidFillr  transparency)r  r   r   _write_a_srgb_clrr   )r[   rk   r  r  s       r^   r  zChart._write_a_solid_fill"  ss     	M***d??!$w-00E88N33L""5,777-(((((r_   c                     d|fg}|rB|                      d|           |                     |           |                     d           d S |                     d|           d S )Nr  z	a:srgbClr)r  _write_a_alphar   r  )r[   r  r  r  s       r^   r  zChart._write_a_srgb_clr/  sw    cl^
 	9Z888 ---k*****Z88888r_   c                     t          dt          |          z
  dz            }d|fg}|                     d|           d S )Nr  r  r  za:alphar  r  r  s      r^   r  zChart._write_a_alpha=  sG     3S>T)**cl^
Iz22222r_   c                 <    d|fg}|                      d|           d S )Nr  z
a:prstDashr  r  s      r^   r  zChart._write_a_prst_dashF  s+     cl^
L*55555r_   c                    |sd S |                      d           |                     |                    d                     |                     |           |                     |d                    |d         dk    r(|                     |                    d                     |d         dk    r(|                     |                    d                     |                     |                    d                     |                     |                    d	                     d
|v r| 	                    |d
                    |                    d          r| 
                                 |                    d          r)|                                  |                     |           |                     d           d S )Nzc:trendlinerd   rB  rK  orderrJ  periodforwardbackward	interceptdisplay_r_squareddisplay_equation)r  _write_namer   r   _write_trendline_type_write_trendline_order_write_period_write_forward_write_backward_write_c_intercept_write_c_disp_rsqr_write_c_disp_eq_write_c_trendline_lblr   )r[   ro   s     r^   r  zChart._write_trendlineM  s     	FM*** 	v../// 	)$$$ 	""9V#4555 V&&''	g(>(>??? V++y}}X66777 	IMM)44555 	Y]]:66777)####Ik$:;;;==,-- 	&##%%%==+,, 	3!!### ''	222-(((((r_   c                 <    d|fg}|                      d|           d S )Nr  zc:trendlineTyper  r  s      r^   r  zChart._write_trendline_type}  s,     cl^
-z:::::r_   c                 :    |d S |                      d|           d S )Nzc:namer  r[   r   s     r^   r  zChart._write_name  s*     <Fx.....r_   c                 L    |dk     rd}d|fg}|                      d|           d S )Nr   r  r  r  r  s      r^   r  zChart._write_trendline_order  s7    77Ccl^
Iz22222r_   c                 L    |dk     rd}d|fg}|                      d|           d S )Nr   r  zc:periodr  r  s      r^   r  zChart._write_period  s7    77Ccl^
J
33333r_   c                 D    |sd S d|fg}|                      d|           d S )Nr  z	c:forwardr  r  s      r^   r  zChart._write_forward  rQ  r_   c                 D    |sd S d|fg}|                      d|           d S )Nr  z
c:backwardr  r  s      r^   r   zChart._write_backward  s8      	Fcl^
L*55555r_   c                 <    d|fg}|                      d|           d S )Nr  zc:interceptr  r  s      r^   r  zChart._write_c_intercept  s)    cl^
M:66666r_   c                 8    dg}|                      d|           d S )Nr  zc:dispEqr  r[   r  s     r^   r  zChart._write_c_disp_eq  s%     \
J
33333r_   c                 8    dg}|                      d|           d S )Nr  z
c:dispRSqrr  r  s     r^   r  zChart._write_c_disp_rsqr  %     \
L*55555r_   c                 X   |                      d           |                     d d            |                                  |                     |d                    |d         r2|d                             d          }|r|                     |           |                     d           d S )Nzc:trendlineLblrP  r   )r  r  _write_trendline_num_fmtr   r   r2  r   )r[   ro   r   s      r^   r  zChart._write_c_trendline_lbl  s    ,--- 	4&&& 	%%''' 	)G,--- W 	,W%))&11D ,%%d+++*+++++r_   c                 :    ddg}|                      d|           d S )N)r]  r  )r^  r   r_  r  r  s     r^   r  zChart._write_trendline_num_fmt  s/     &


 	J
33333r_   c                     | j         }|d S d|v rO|d         d         rA|                     d           |                     |           |                     d           d S |                     d           d S )Nri   r  zc:hiLowLines)rG   r  r   r   r  )r[   rG   s     r^   _write_hi_low_lineszChart._write_hi_low_lines  s    (F\!!l6&:9&E!/// l+++n-----/////r_   c                     | j         }|d S |d         d         rA|                     d           |                     |           |                     d           d S |                     d           d S )Nri   r  zc:dropLines)rF   r  r   r   r  )r[   rF   s     r^   _write_drop_lineszChart._write_drop_lines  s    _
Ffi( 	/... j)))m,,,,,.....r_   c                 D    |d S d|fg}|                      d|           d S )Nr  z	c:overlapr  r  s      r^   _write_overlapzChart._write_overlap  s5     ;Fcl^
K44444r_   c                    |rt          |          }nd}|                     d           |                     d           |                     |           t	          |          D ]F}||         }|	 t          |           n# t          $ r d}Y nw xY w|                     ||           G|                     d           d S )Nr   z
c:numCacher  	r   r  _write_format_coder  ranger+  r,  r  r   r[   r   r  r   r-  s        r^   r  zChart._write_num_cache  s     	IIEEEL))) 		*** 	U###u 	% 	%AGE}e   
 NN1e$$$$,'''''s   1BBBc                     t          |          }|                     d           |                     |           t          |          D ]}|                     |||                    |                     d           d S )Nz
c:strCache)r   r  r  r  r  r   )r[   r   r  r   s       r^   r  zChart._write_str_cache.  s    D		L))) 	U###u 	' 	'ANN1d1g&&&&,'''''r_   c                 2    |                      d|           d S )Nzc:formatCoder  r  s     r^   r  zChart._write_format_code=  s      	~t44444r_   c                 <    d|fg}|                      d|           d S )Nr  z	c:ptCountr  r  s      r^   r  zChart._write_pt_countB  rm  r_   c                     |d S d|fg}|                      d|           |                     |           |                     d           d S )Nidxzc:ptr  )r[   r#  rW  r  s       r^   r  zChart._write_ptI  s]     =Fcl^
FJ/// 	e&!!!!!r_   c                 2    |                      d|           d S )Nzc:vr  r  s     r^   r  zChart._write_vX  s      	ud+++++r_   c                 B    | j         sd S |                     d           d S )Nzc:protection)r-   r  r   s    r^   r   zChart._write_protection]  s+     	FN+++++r_   c                 X    d}|sd S |D ] }|dz  }|s
|                      ||           !d S )Nr   r   )_write_d_pt_point)r[   rs   r  r  s       r^   r  zChart._write_d_ptd  sZ     	F 	1 	1EQJE ""5%0000	1 	1r_   c                     |                      d           |                     |           |                     |           |                     d           d S )Nzc:dPt)r  r  r   r   )r[   r  r  s      r^   r'  zChart._write_d_pt_pointr  s\     	G$$$ 	 	%   '"""""r_   c                 Z   |sd S |                      d           |                    d          r|                     ||d                    |                    d          r|                     |d                    |                     |           |                    d          r|                     |d                    |                    d          r|                     |d                    |                    d          r|                                  |                    d          r|                                  |                    d          r| 	                                 |                    d	          r| 
                                 |                    d
          r|                                  |                    d          r|                     |d                    |                    d          r|                                  |                     d           d S )Nzc:dLblsra  r   r   r   
legend_keyrW  categoryseries_namerZ  rl  leader_lines)r  r   _write_custom_labelsre  r   r2  _write_d_lbl_pos_write_show_legend_key_write_show_val_write_show_cat_name_write_show_ser_name_write_show_percent_write_separator_write_show_leader_linesr   )r[   r{   s     r^   r  zChart._write_d_lbls  s3     	FI&&& ::h 	@%%ffX.>??? ::l## 	G001EFFF 	&!!! ::f 	2!!&.111 ::j!! 	6!!&"4555 ::l## 	*''))) ::g 	#  """ ::j!! 	(%%''' ::m$$ 	(%%''' ::l## 	'$$&&& ::k"" 	7!!&"5666 ::n%% 	,))+++)$$$$$r_   c                    d}|D ]<}|dz  }||                      d           |                     |dz
             |                    d          }|r|                     d           n|                    d          r|                     |           |                    d          r|                     |d                    |                    d          r|                                  |                    d          r|                                  |                    d	          r|                                  n|                    d          r| 	                    |           |                    d          r|                     |d                    |                    d          r|                                  |                    d          r|                                  |                    d	          r|                                  n| 
                    |           |                     d           >d S )
Nr   r   zc:dLbldeleter   r   rW  r+  r,  )r  r  r   r*  _write_custom_label_formular/  r1  r2  r3  _write_custom_label_str_write_custom_label_format_onlyr   )r[   parentr{   r  rP  delete_labels         r^   r.  zChart._write_custom_labels  sI    ,	( ,	(EQJE}))) OOEAI&&& 99X..L <""1%%%%9%% <00777::j)) >))&*<===::g&& +((***::j)) 0--///::m,, 0--///7## <,,U333::j)) >))&*<===::g&& +((***::j)) 0--///::m,, 0--///44U;;;h''''Y,	( ,	(r_   c                 `   |                     d          }|                     d          }|                     |          }|                     d d            |                     d           |                     ||d|            |                     d           |                     |           d S )NrW  r   r  F)r   r  r  r  r  r   r   )r[   rP  r  r   has_formattings        r^   r:  zChart._write_custom_label_str  s    		'""yy  22599 	4&&&F### 	e-?@@@&!!! 	%     r_   c                 T   |                     d          }|                     d          }d }|| j        |         }|                     d d            |                     d           |                     ||d           |                     d           |                     |           d S )Nr   r   r  r(  )r   r*   r  r  r  r   r;  )r[   rP  r   r   r   s        r^   r9  z!Chart._write_custom_label_formula  s    ))I&&))I&&$W-D 	4&&&F### 	GT5111&!!! 	,,U33333r_   c                    |                     d          }|                     |          }|r,|                     |           |                     |           d S |r,|                     d           |                     |           d S d S )Nr   r  )r   r  r   r  r  )r[   rP  r   r?  s       r^   r;  z%Chart._write_custom_label_format_only  s    yy  22599 	$e$$$d##### 	$)))d#####	$ 	$r_   c                 @    d}d|fg}|                      d|           d S )Nr	  r  zc:showLegendKeyr  r  s      r^   r0  zChart._write_show_legend_key  s/    cl^
-z:::::r_   c                 @    d}d|fg}|                      d|           d S )Nr   r  z	c:showValr  r  s      r^   r1  zChart._write_show_val'  r  r_   c                 @    d}d|fg}|                      d|           d S )Nr   r  zc:showCatNamer  r  s      r^   r2  zChart._write_show_cat_name/  .    cl^
OZ88888r_   c                 @    d}d|fg}|                      d|           d S )Nr   r  zc:showSerNamer  r  s      r^   r3  zChart._write_show_ser_name7  rE  r_   c                 @    d}d|fg}|                      d|           d S )Nr   r  zc:showPercentr  r  s      r^   r4  zChart._write_show_percent?  rE  r_   c                 2    |                      d|           d S )Nzc:separatorr  r  s     r^   r5  zChart._write_separatorG  s    }d33333r_   c                     d}d}d|fd|fg}|                      d           |                      d|           |                     ddg           |                     d           |                     d           d S )	Nz&{CE6537A1-D6FC-4f65-9D91-7224C49458BB}z6http://schemas.microsoft.com/office/drawing/2012/chartr  z	xmlns:c15r  r  zc15:showLeaderLinesr  r  )r[   r  
xmlns_c_15r  s       r^   r6  zChart._write_show_leader_linesK  s     7M
 CL*%


 	J'''GZ0001J<@@@'"""*%%%%%r_   c                 <    d|fg}|                      d|           d S )Nr  z	c:dLblPosr  r  s      r^   r/  zChart._write_d_lbl_pos_  rm  r_   c                 <    d|fg}|                      d|           d S )Nr  zc:deleter  r  s      r^   r*  zChart._write_deletef  r  r_   c                 H    d}|sd S d|fg}|                      d|           d S )Nr   r  zc:invertIfNegativer  )r[   invertr  r  s       r^   r  z!Chart._write_c_invert_if_negativem  s<     	Fcl^
0*=====r_   c                    |sd S |                      d           |                     |                    d          d            |                                  |                      d           |                     |           |                                  |                     d           |                     d           d S )Nr  r  r  )r  r  r   r  r  r  r   r  s     r^   r2  zChart._write_axis_fontx  s      	FH%%%dhhz22D999!!!E"""%%%""$$$%   (#####r_   c                 2    |                      d|           d S )Nza:latinr  r  s     r^   r  zChart._write_a_latin  s    Iz22222r_   c                    | j         }|sd S |                     d           |d         r|                                  |d         r|                                  |d         r|                                  |d         r|                                  |d         r|                     |d                    |                     d           d S )Nzc:dTabler   r   r   r   r   )r?   r  _write_show_horz_border_write_show_vert_border_write_show_outline_write_show_keysr  r   )r[   r?   s     r^   r  zChart._write_d_table  s    
 	FJ''' 	+((*** 	+((*** 	'$$&&& 	$!!###= 	-eFm,,,*%%%%%r_   c                 8    dg}|                      d|           d S )Nr  zc:showHorzBorderr  r  s     r^   rR  zChart._write_show_horz_border  &     \
.
;;;;;r_   c                 8    dg}|                      d|           d S )Nr  zc:showVertBorderr  r  s     r^   rS  zChart._write_show_vert_border  rW  r_   c                 8    dg}|                      d|           d S )Nr  zc:showOutliner  r  s     r^   rT  zChart._write_show_outline  s%     \
OZ88888r_   c                 8    dg}|                      d|           d S )Nr  z
c:showKeysr  r  s     r^   rU  zChart._write_show_keys  r  r_   c                     |sd S |d         r|                      d|d                    |d         r|                      d|d                    d S d S )Nrr   r9  rq   rx  )_write_err_barsr[   r~   s     r^   r  zChart._write_error_bars  su      	Fn% 	B  j&@AAAn% 	B  j&@AAAAA	B 	Br_   c                    |sd S |                      d           |                     |           |                     |d                    |                     |d                    |d         s|                                  |d         dk    rn=|d         dk    r|                     |           n|                     |d                    |                     |           |                     d           d S )Nz	c:errBarsrY  rB  rX  r\  r]  rW  )	r  _write_err_dir_write_err_bar_type_write_err_val_type_write_no_end_cap_write_custom_error_write_error_valr   r   )r[   rY  r~   s      r^   r\  zChart._write_err_bars  s     	FK((( 	I&&& 	  K!8999 	  F!3444(# 	%""$$$f))6))$$Z0000 !!*W"5666 	*%%%+&&&&&r_   c                 <    d|fg}|                      d|           d S )Nr  zc:errDirr  r  s      r^   r_  zChart._write_err_dir  r  r_   c                 <    d|fg}|                      d|           d S )Nr  zc:errBarTyper  r  s      r^   r`  zChart._write_err_bar_type  +     cl^
NJ77777r_   c                 <    d|fg}|                      d|           d S )Nr  zc:errValTyper  r  s      r^   ra  zChart._write_err_val_type  rg  r_   c                 8    dg}|                      d|           d S )Nr  z
c:noEndCapr  r  s     r^   rb  zChart._write_no_end_cap	  r  r_   c                 <    d|fg}|                      d|           d S )Nr  r  r  r  s      r^   rd  zChart._write_error_val  r  r_   c                 :   |d         r|                      d           t          |d         t                    r|                     |d                    n#|                     |d         |d         d           |                     d           |d         r|                      d           t          |d         t                    r|                     |d                    n#|                     |d         |d         d           |                     d           d S d S )Nrd  zc:plusrf  r)  re  zc:minusrg  )r  r  r  _write_num_litr  r   r]  s     r^   rc  zChart._write_custom_error  s:    m$ 
	()))*]3T:: ##J}$=>>>>##}-z+/F   h'''n% 
	)	****^4d;; ##J~$>????##~.
<0H%   i(((((
	) 
	)r_   c                 x   t          |          }|                     d           |                     d           |                     |           t	          |          D ]F}||         }|	 t          |           n# t          $ r d}Y nw xY w|                     ||           G|                     d           d S )Nzc:numLitr  r   r  r  s        r^   rl  zChart._write_num_lit1  s    D		 	J''' 		*** 	U###u 	% 	%AGE}e   
 NN1e$$$$*%%%%%s   ,A<<B
Bc                 :   | j         }|d S |                     d           |                     d           |                     |                    d                     |                     |                    d                     |                     d           d S )Nzc:upDownBars   r   r   )rH   r  _write_gap_width_write_up_barsr   _write_down_barsr   )r[   rH   s     r^   _write_up_down_barszChart._write_up_down_barsO  s    (FN+++ 	c""" 	L,,T22333 	l..v66777.)))))r_   c                 D    |d S d|fg}|                      d|           d S )Nr  z
c:gapWidthr  r  s      r^   rp  zChart._write_gap_widthc  s5     ;Fcl^
L*55555r_   c                     |d         rO|d         d         rA|                      d           |                     |           |                     d           d S |                     d           d S )Nri   r  zc:upBarsrz  r[   
bar_formats     r^   rq  zChart._write_up_barsm  s     f 	,*V"4Y"? 	,
+++ j)))j)))))
+++++r_   c                     |d         rO|d         d         rA|                      d           |                     |           |                     d           d S |                     d           d S )Nri   r  z
c:downBarsrz  rv  s     r^   rr  zChart._write_down_barsz  s     f 	.*V"4Y"? 	.--- j)))l+++++-----r_   c                    |sd S d|fg}|                      d           |                     d|           |r?|                      d           |                     d           |                     d           |                     d           d S )Nr  zc:dispUnitszc:builtInUnitzc:dispUnitsLblr  r  )r[   unitsdisplayr  s       r^   rC  zChart._write_disp_units  s      	Fen%
M***OZ888 	0 0111
+++.///-(((((r_   c                 f   ddg}|d         dk    rg }|                      d|           |                     |           |d         dk    r|                     |d                    n6|                     |d                    |                     |d                    |                     d           d S )N)flipr   )rotWithShaper	  rB  rH  z
a:gradFillangle)r  _write_a_gs_lst_write_a_lin_write_a_path_write_a_tile_rectr   )r[   rm   r  s      r^   r  zChart._write_a_grad_fill  s     '(=>
Fx''JL*555 	X&&&Fx''hw/0000 x/000 ##HV$4555,'''''r_   c                    |d         }|d         }|                      d           t          t          |                    D ]t}t          ||         dz            }d|fg}|                      d|           t	          ||                   }|                     |           |                     d           u|                     d           d S )N	positionscolorsza:gsLstr  posza:gs)r  r  r   r  r   r  r   )r[   rm   r  r  r   r  r  r  s           r^   r  zChart._write_a_gs_lst  s    [)	(#I&&&s6{{## 		& 		&AilT)**C #,J
333 "&),,E""5)))f%%%%)$$$$$r_   c                 b    t          d|z            }d|fdg}|                     d|           d S )Nr  ang)scaled0za:linr  )r[   r  r  s      r^   r  zChart._write_a_lin  sF     EEM"" EN


 	GZ00000r_   c                     d|fg}|                      d|           |                     |           |                     d           d S )Npathza:path)r  _write_a_fill_to_rectr   r[   gradient_typer  s      r^   r  zChart._write_a_path  sW     }-.
Hj111 	""=111(#####r_   c                 P    |dk    rg d}nddg}|                      d|           d S )Nshape))r   50000)rZ  r  )rY  r  )r   r  )r   100000)rZ  r  za:fillToRectr  r  s      r^   r  zChart._write_a_fill_to_rect  sO     G##  JJ  J
 	NJ77777r_   c                 L    |dk    rg }nddg}|                      d|           d S )Nr  )rY  -100000)r   r  z
a:tileRectr  r  s      r^   r  zChart._write_a_tile_rect  sC     G##JJ ! J
 	L*55555r_   c                     d|d         fg}|                      d|           |                     |d                    |                     |d                    |                     d           d S )Nprstrl   z
a:pattFillfg_colorbg_color)r  _write_a_fg_clr_write_a_bg_clrr   )r[   rl   r  s      r^   r  zChart._write_a_patt_fill  s|     wy123
L*555 	WZ0111 	WZ0111,'''''r_   c                     t          |          }|                     d           |                     |           |                     d           d S )Nza:fgClrr   r  r  r   r[   r  s     r^   r  zChart._write_a_fg_clr  U     e$$I&&& 	u%%%)$$$$$r_   c                     t          |          }|                     d           |                     |           |                     d           d S )Nza:bgClrr  r  s     r^   r  zChart._write_a_bg_clr  r  r_   r  )F)__name__
__module____qualname____doc__r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r.  r   r   r   rQ  r   r
  r   r   r   r   r   r  r	  r  r  r  r  rZ   r   r   r   r   r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r%  r$  r  r  rE  r  r)  rJ  rK  rL  rM  r+  r?  r.  re  r/  r0  r1  r3  r4  r5  r6  r7  r8  r9  r:  r,  r-  r@  rA  rB  rG  rH  r  r  r  r  r  r   r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r   r  r  r  r  r  r  r  r  r  r  r  r  r   r  r  r  r  r  r  r  r  r  r  r  r  r  r  r   r  r'  r  r.  r:  r9  r;  r0  r1  r2  r3  r4  r5  r6  r/  r*  r  r2  r  r  rR  rS  rT  rU  r  r\  r_  r`  ra  rb  rd  rc  rl  rs  rp  rq  rr  rC  r  r  r  r  r  r  r  r  r  __classcell__)r]   s   @r^   r   r      s        H' H' H' H' H' H'TN# N# N# N#`        !. !. !. !.F; ; ;; ; ;< < <! ! !&" " "2
% 
% 
%
  
  
 3 3 3 3*   05
 5
 5
 5
n%
 %
 %
 %
N%
 %
 %
 %
N   ,  BB B BH  8  "" " "   <     DB B BH= = =~+ + +Z4 4 4l	 	 	x x xt& & &P2 2 2 2h, , ,\+ + +Z  $  2  (# # #% % %' ' '   N8 8 82 2 2
3 
3 
3+% +% +%Z
: 
: 
:F( F( F(P
* 
* 
*, , ,*  
6 6 6     3# 3# 3#j& & &2& & &*1 1 13 3 31 1 1< < <!# !# !#F# # #& & & & & &". . .:/ / /3 3 32 2 2d% d% d%Lg% g% g%Re% e% e%Nq& q& q&f' ' '&5 5 5	9 	9 	91 1 11 1 13 3 34 4 4.4 4 46	4 	4 	4; ; ;; ; ;8 8 8 85 5 55 5 5 57 7 72 2 25 5 5 5 7 7 79 9 9: : :4 4 4&4 4 4&: : :7 7 77 7 7; ; ; ;; ; ; ;6& 6& 6&p7 7 7+ + +5 5 5
9 
9 
9- - -. . .9 9 9(+ + +@ @ @% % % %$ @E% % % %," " "" " "" " "$ $ $*4 4 4,* * *! ! !! ! !# # #> > >.8 8 8! ! !; ; ;6- - -
$ $ $ $*& & &22 2 24 4 4$ $ $>#4 #4 #4J( ( () ) )9 9 9 93 3 36 6 6.) .) .)`; ; ;/ / /3 3 34 4 45 5 56 6 67 7 74 4 46 6 6, , ,*4 4 40 0 0"/ / /"5 5 5( ( (@( ( (5 5 5
5 5 5" " ", , ,
, , ,1 1 1# # #7% 7% 7%r0( 0( 0(d! ! !&4 4 4,
$ 
$ 
$; ; ;5 5 59 9 99 9 99 9 94 4 4& & &(5 5 54 4 4	> 	> 	>$ $ $"3 3 3& & &>< < << < <9 9 96 6 6
B 
B 
B"' "' "'H4 4 48 8 88 8 86 6 61 1 1) ) )6& & &<* * *(6 6 6, , ,. . .) ) )$( ( (2% % %(
1 
1 
1
$ 
$ 
$8 8 8$6 6 6( ( (
% 
% 
%
% 
% 
% 
% 
% 
% 
%r_   r   )r#  r  warningsr   r  r   r   r   utilityr   r	   r
   r   r   r   	XMLwriterr   r  r_   r^   <module>r     s   
			                    " " " " " " & & & & & & % % % % % % ' ' ' ' ' ' / / / / / / $ $ $ $ $ $LD% LD% LD% LD% LD%I LD% LD% LD% LD% LD%r_   