
    h                        S SK r S SKrS SKJr  S SKJrJr  SSKJr  SSK	J
r
  SSKJrJrJrJrJr   " S S	\R"                  5      rg)
    Nwarn)Color
ColorTypes   )	xmlwriter)Shape)_datetime_to_excel_datetime_supported_datetimequote_sheetnamexl_range_formulaxl_rowcol_to_cellc                     ^  \ rS rSrSrU 4S jrSS jrS rS rS r	S r
SS	 jrS
 rS rS rS rS rS rS rSS jrSS jrSS jrSS jrSS jrSS jrS rS rS rS rS rS rS rS r S r!S  r"S! r#S" r$S# r%S$ r&SS% jr'S& r(S' r)S( r*S) r+S* r,S+ r-S, r.S- r/S. r0S/ r1S0 r2S1 r3S2 r4S3 r5S4 r6S5 r7S6 r8S7 r9S8 r:S9 r;S: r<S;\=4S< jr>S= r?S> r@S? rAS@ rBSA rCSB rDSC rESD rFSE rGSF rHSG rISH rJSI rKSJ rLSK rMSL rNSM rOSN rPSO rQSP rRSQ rSSR rTSS rUST rVSU rWSV rXSW rYSX rZSSY jr[SZ r\SS[ jr]S\ r^S] r_SS^ jr`S_ raS` rbSa rcSb rdSc reSd rfSe rgSf rhSSg jriSSh jrjSi rkSj rlSk rmSl rnSm roSn rpSo rqSp rrSq rsSr rtSSs jru SSt jrvSu rwSv rxSw rySx rzSy r{Sz r|S{ r}S| r~S} rS~ rS rS rS rS rSS jrS rS rS rS rS rS rS rSS;\=4S jjrS rSS;\=4S jjrSS;\=4S jjrS\4S jrS\4S jrS rS rS rS rS rS rS rS rS rS rS rS rS rS rS rS rS rS rS rS rS rS rS rS rS rS rS rS rS rS rS rS rS rS rS rS rS rS rS rS rS rS rS rS rS rS rS rS rS rS rS rS rS rS rS rS rS rS rS rS rS rS rS rS rS rS rS rS rS rS;\=4S jrS;\=4S jrSrU =r$ )Chart   z2
A class for writing the Excel XLSX Chart file.


c                   > [         TU ]  5         SU l        SU l        SU l        / U l        SU l        SU l        SU l        SU l	        / U l
        / U l        SU l        SU l        0 U l        SU l        SU l        0 U l        / U l        SU l        S	U l        SU l        0 U l        0 U l        0 U l        0 U l        0 U l        0 U l        S
U l        SU l        SU l        SU l        SU l         SU l!        SU l"        S	U l#        S	U l$        SU l%        SU l&        SU l'        SU l(        SU l)        SU l*        SU l+        SU l,        SU l-        SU l.        SU l/        SU l0        SU l1        SU l2        SU l3        SU l4        SU l5        SU l6        SU l7        SU l8        SU l9        SU l:        SU l;        0 U l<        S
U l=        SU l>        SU l?        SU l@        SU lA        U R                  5         0 U lC        g)z
Constructor.

Ni   r      Fblr    gapTi  i   between)Dsuper__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fill)self	__class__s    cC:\Users\julio\OneDrive\Documentos\Trabajo\Ideas Frescas\venv\Lib\site-packages\xlsxwriter/chart.pyr   Chart.__init__(   s    	 $!&!$!$  %  

&"   $ $  #!! !"$!&(# %!"$$&	    c                 &   Uc  0 nSU;  a  [        S5        gU R                  (       a  SU;  a  [        S5        g[        U R                  5      S:X  a  [        S5        gU R	                  UR                  S5      5      nU R	                  UR                  S5      5      nU R                  UR                  S5      UR                  S	5      5      u  pEU R                  X1R                  S
5      5      nU R                  X!R                  S5      5      nU R                  XQR                  S5      5      n[        R                  " UR                  S5      5      n	UR                  S5      (       a  [        R                  " US   5      n	[        R                  " UR                  S5      5      n
[        R                  " UR                  S5      5      n[        R                  " UR                  S5      5      nU(       a  SU l        U(       a  SnSn
U R                  UR                  S5      5      nU R                  UR                  S5      5      nUR                  S5      nU R!                  UR                  S5      5      nU R!                  UR                  S5      5      nUUS.nU R#                  UR                  S5      5      nU R%                  UR                  S5      5      nUR                  SS5      nUR                  S5      nU(       a  [&        R(                  " U5      nUR                  S5      nUR                  S5      nU(       d  U(       a  SU l        UR                  S 5      b  U(       a  US    U l        O
US    U l        UR                  S!5      (       a  U(       a  US!   U l        O
US!   U l        0 SU_SU_SU_S	U_S"U_S#U_S$U_SU	_SU
_SU_SU_SU_SU_S%U_S&U_S'U_SU_UUUUS(.EnU R                  R5                  U5        g))zr
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borderr]   patterngradientmarker	trendlinesmoothy_error_barsx_error_bars)rt   rs   pointsdata_labelsinvert_if_negativeFinvert_if_negative_colorr5   r4   Tr   overlapname_idval_data_idcat_data_idlabelsinvert_if_neginverted_color)r4   ru   
error_barsrr   )r   r'   lenr   _list_to_formulaget_process_names_get_data_idr	   _get_line_properties_get_fill_properties_get_pattern_properties_get_gradient_propertiesr]   _get_marker_properties_get_trendline_properties_get_error_bars_props_get_points_properties_get_labels_propertiesr   _from_valuerZ   rE   rD   rG   rF   append)r^   optionsrd   re   rg   rh   cat_idval_idrz   rl   r]   rn   ro   rp   rq   rr   rs   rt   r   ru   r}   r~   r   r5   r4   r   s                             r`   
add_seriesChart.add_seriess   s*    ?G 7"89!!l'&APQt{{s"%  &&w{{8'<=**7;;|+DE
 "00KK^!<

 "":{{;L/MN""6;;}+EF##L++k2JK ))'++f*=> ;;x  --gh.?@D ))'++f*=> //I0FG 11'++j2IJ DI GD ,,W[[-BC 227;;{3KL	 X& 11'++n2MN11'++n2MN&2LQ
 ,,W[[-BC ,,W[[-GH  $8%@ %?@"..~>N ++i(++i( g $D ;;u)$+EN!$+EN! ;;y!!(/	(:%(/	(:%
f
*
 D
 L	

 w
 6
 6
 D
 D
 w
 
 f
 
 f
 ]
  n!
" w#
$ $+
0 	6"rb   c                 H    U R                  U R                  U5      nX l        g)zj
Set the chart X axis options.

Args:
    options:  A dictionary of axis options.

Returns:
    Nothing.

N)_convert_axis_argsr2   r^   r   axiss      r`   
set_x_axisChart.set_x_axis       &&t{{G<rb   c                 H    U R                  U R                  U5      nX l        g)zi
Set the chart Y axis options.

Args:
    options: A dictionary of axis options.

Returns:
    Nothing.

N)r   r3   r   s      r`   
set_y_axisChart.set_y_axis  r   rb   c                 H    U R                  U R                  U5      nX l        g)zs
Set the chart secondary X axis options.

Args:
    options: A dictionary of axis options.

Returns:
    Nothing.

N)r   r5   r   s      r`   set_x2_axisChart.set_x2_axis$       &&t||W=rb   c                 H    U R                  U R                  U5      nX l        g)zs
Set the chart secondary Y axis options.

Args:
    options: A dictionary of axis options.

Returns:
    Nothing.

N)r   r4   r   s      r`   set_y2_axisChart.set_y2_axis3  r   rb   c                    Uc  0 nU R                  UR                  S5      UR                  S5      5      u  p#U R                  X1R                  S5      5      nX l        X0l        X@l        U R                  UR                  S5      5      U l        U R                  UR                  S5      S5      U l	        UR                  S5      U l
        UR                  S	5      U l        g)
zo
Set the chart title options.

Args:
    options: A dictionary of chart title options.

Returns:
    Nothing.

Nrg   rh   data	name_fontlayoutToverlaynone)r   r   r   rM   rN   rO   _convert_font_argsrL   _get_layout_propertiesrP   rQ   rR   )r^   r   rg   rh   data_ids        r`   	set_titleChart.set_titleB  s     ?G!00KK^!<
 ##L++f2EF)$ 11'++k2JK !77H8MtT$[[3 "++f-rb   c                 0    U R                  U5      U l        g)zp
Set the chart legend options.

Args:
    options: A dictionary of chart legend options.

Returns:
    Nothing.
N)_get_legend_propertiesr(   r^   r   s     r`   
set_legendChart.set_legende  s     11':rb   c                 0    U R                  U5      U l        g)zv
Set the chart plot area options.

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

Returns:
    Nothing.
N)_get_area_propertiesr1   r   s     r`   set_plotareaChart.set_plotarear  s     11':rb   c                 0    U R                  U5      U l        g)zl
Set the chart area options.

Args:
    options: A dictionary of chart area options.

Returns:
    Nothing.
N)r   r0   r   s     r`   set_chartareaChart.set_chartarea  s     227;rb   c                 6    Uc  SnUS:  d  US:  a  SnXl         g)zl
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_styleChart.set_style  s&     Ha<8b=H rb   c                 V    U(       d  gSSSS.nX;  a  [        SU S35        gXl        g)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 '')r   r7   )r^   optionvalid_optionss      r`   show_blanks_asChart.show_blanks_as  s?      
 &4VHA>?!rb   c                     SU l         g)zZ
Display ``#N/A`` on charts as blank/empty cells.

Args:
    None.

Returns:
    Nothing.
TN)r8   r^   s    r`   show_na_as_empty_cellChart.show_na_as_empty_cell  s     !%rb   c                     SU l         g)z]
Display data on charts from hidden rows or columns.

Args:
    None.

Returns:
    Nothing.
TN)r9   r   s    r`   show_hidden_dataChart.show_hidden_data  s      rb   c                 J   Uc  0 nUR                  SU R                  5      U l        UR                  SU R                  5      U l        UR                  SS5      U l        UR                  SS5      U l        UR                  SS5      U l        UR                  S	S5      U l        g)
zp
Set size or scale of the chart.

Args:
    options: A dictionary of chart size options.

Returns:
    Nothing.
Nr;   r<   r=   r   r>   r?   r   r@   )r   r;   r<   r=   r>   r?   r@   r   s     r`   set_sizeChart.set_size  s     ?G [[$**5
kk(DKK8{{9a0{{9a0J2J2rb   c                    Uc  0 n0 nUR                  SS5      US'   UR                  SS5      US'   UR                  SS5      US'   UR                  SS5      US'   U R                  UR                  S5      5      US'   X l        g)	zx
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   rA   )r^   r   rA   s      r`   	set_tableChart.set_table  s     ?G%kk,:l#KK
A6j";;y!4i$[[a8k//F0CDf
rb   c                 R   Uc  0 nSnSnSnSnUR                  S5      (       ao  SUS   ;   a  [        R                  " US   S   5      nSUS   ;   a  [        R                  " US   S   5      nSUS   ;   a  [        R                  " US   S   5      nUR                  S5      (       ao  SUS   ;   a  [        R                  " US   S   5      nSUS   ;   a  [        R                  " US   S   5      nSUS   ;   a  [        R                  " US   S   5      nUUS.UUS.S.U l        g)	zq
Set properties for the chart up-down bars.

Args:
    options: A dictionary of options.

Returns:
    Nothing.

Nuprm   rl   r]   down)rl   r]   )r   r   )r   r	   r   r   rJ   )r^   r   up_lineup_fill	down_line	down_fills         r`   set_up_down_barsChart.set_up_down_bars  sH    ?G 		 ;;t74=(44WT]85LM&44WT]65JK&44WT]65JK ;;v76?*!66wvx7PQ	(!66wvv7NO	(!66wvv7NO	  
 "!	
rb   c                    Uc  0 n[         R                  " UR                  S5      5      n[         R                  " UR                  S5      5      n[         R                  " UR                  S5      5      n[         R
                  " UR                  S5      5      nU(       a  SU l        U(       a  SnSnUUUUS.U l        g)zo
Set properties for the chart drop lines.

Args:
    options: A dictionary of options.

Returns:
    Nothing.

Nrl   r]   rn   ro   rl   r]   rn   ro   )r	   r   r   r   r   r   r]   rH   r^   r   rl   r]   rn   ro   s         r`   set_drop_linesChart.set_drop_lines4  s     ?G))'++f*=>))'++f*=> //I0FG 11'++j2IJ DI GD  	
rb   c                    Uc  0 n[         R                  " UR                  S5      5      n[         R                  " UR                  S5      5      n[         R                  " UR                  S5      5      n[         R
                  " UR                  S5      5      nU(       a  SU l        U(       a  SnSnUUUUS.U l        g)zs
Set properties for the chart high-low lines.

Args:
    options: A dictionary of options.

Returns:
    Nothing.

Nrl   r]   rn   ro   r   )r	   r   r   r   r   r   r]   rI   r   s         r`   set_high_low_linesChart.set_high_low_lines[  s     ?G))'++f*=>))'++f*=> //I0FG 11'++j2IJ DI GD  	
rb   c                     Uc  gXl         g)z
Create a combination chart with a secondary chart.

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

Returns:
    Nothing.

N)rY   )r^   charts     r`   combineChart.combine  s     =rb   c                 ~   U R                  5         U R                  5         U R                  5         U R                  5         U R	                  5         U R                  5         U R                  U R                  5        U R                  (       a  U R                  5         U R                  S5        U R                  5         g )Nc:chartSpace)_xml_declaration_write_chart_space_write_lang_write_style_write_protection_write_chart_write_sp_prr0   r    _write_print_settings_xml_end_tag
_xml_closer   s    r`   _assemble_xml_fileChart._assemble_xml_file  s     	 	! 	 	 	  	 	$..) ==&&( 	.)rb   c                 4   US   R                  5       nUR                  U5        U R                  UR                  S5      UR                  S5      5      u  pEU R	                  XSR                  S5      5      n0 SUS   _SU_SU_SU_SUR                  S5      _SUR                  S5      _S	UR                  S	5      _S
UR                  S
5      _SUR                  S5      _SUR                  S5      _SUR                  S5      _SUR                  S5      _SUR                  S5      _SUR                  S5      _SUR                  S5      _SUR                  S5      _SUR                  S5      _UR                  S5      UR                  S5      UR                  S5      UR                  S5      UR                  S5      SS.EnUR                  SS5      US'   U R                  US   5      US'   UR                  SS5      US'   UR                  S5      (       a$  US   S   (       a  U R                  US   5      US'   UR                  S5      (       a$  US   S   (       a  U R                  US   5      US'   UR                  S5      (       a  US   R                  5       S    US'   UR                  S5      (       a  US   S!:X  a  S"US'   OUS   S#:X  a  OS US'   UR                  S$5      (       a  SU l        UR                  S%5      (       a  SU l        SUS%'   UR                  S5      (       a:  [        US   5      (       a'  [        US   U R                  U R                  5      US'   UR                  S	5      (       a:  [        US	   5      (       a'  [        US	   U R                  U R                  5      US	'   UR                  S5      (       a:  [        US   5      (       a'  [        US   U R                  U R                  5      US'   U R                  UR                  S&5      5      US&'   U R                  UR                  S'5      5      US''   U R                  UR                  S(5      S5      US('   [        R                   " UR                  S)5      5      US)'   [        R"                  " UR                  S*5      5      US*'   [        R$                  " UR                  S+5      5      US+'   [        R&                  " UR                  S,5      5      US,'   UR                  S+5      (       a  S US*'   UR                  S,5      (       a
  S US+'   S US*'   U R)                  UR                  S-5      5      US-'   U R)                  UR                  S.5      5      US.'   U$ )/Ndefaultsrg   rh   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visibleTdisplay_units_visiblemajor_gridlinesminor_gridlinesr   on_tickmidCatr   	date_axisr  num_fontr   name_layoutrl   r]   rn   ro   minor_tick_markmajor_tick_mark)copyupdater   r   r   _get_display_units_get_gridline_propertieslowerrS   r   r
   rT   rU   r   r   r	   r   r   r   r   _get_tick_type)r^   r   user_optionsr   rg   rh   r   s          r`   r   Chart._convert_axis_args  s   z"'')|$!00KK^!<
 ##L++f2EF
Z(
D
 |
 w	

 w{{9-
 7;;u%
 7;;u%
 '++l3
 '++l3
 w{{+<=
 w{{+<=
 W[[9
 J/
 J/
 W[[9
  J/!
" gkk*:;#
$ #;;}5!++l3!(-@!A$[[9$[[9/
4 "++i6Y !% 7 7_8M N_(/4KT(R$% ;;())g6G.H.S&*&C&C)*'D"#
 ;;())g6G.H.S&*&C&C)*'D"#
 88J#J/557:D 88O$$O$	1(0_%o&)3 )-_% ;;{##!%D ;;{##!&D $D 88E??24;??5UT^^T-A-ADK 88E??24;??5UT^^T-A-ADK 88J$7Z8H$I$I:Z $..$2F2F D
  227;;z3JKZ 33GKK4LM[ #99KK&
]
 11'++f2EFV 11'++f2EFV  77I8NOY !99'++j:QRZ 88IDL 88J"DODL #'"5"5gkkBS6T"U"&"5"5gkkBS6T"Urb   c                 <   U(       d  0 $ UR                  S5      UR                  S5      UR                  S5      UR                  S5      UR                  S5      UR                  S5      UR                  S5      UR                  S5      UR                  S	S
5      UR                  S5      S.
nUS   (       a  [        US   S-  5      US'   US   (       a  S[        US   5      -  US'   UR                  S5      (       a  [        R                  " US   5      US'   U$ )Nrg   colorsizebolditalic	underlinepitch_familycharsetbaseliner   rotation)
rg   r)  r*  r+  r,  r-  r.  r/  r0  r1  d   `  )r   intr   r   )r^   r   r   s      r`   r   Chart._convert_font_args:  s    I KK'[[)KK'KK'kk(+ [1#KK7{{9-J2J/
 <tF|c12DL 
$s4
+;'<<D88G!--d7m<DMrb   c                     [        U[        5      (       d5  U(       a,  SU;   a&  SU;  a   U R                  (       a  [        SU S35        U$ [	        U6 nU$ )N r   zSheetname in 'zE' contains spaces but isn't quoted. This may cause an error in Excel.)
isinstancelistr[   r   r   )r^   r   r  s      r`   r   Chart._list_to_formulaY  sW     $%%t4D<O<O$TF +8 9 K"D)rb   c                     Ubb  [        U[        5      (       a-  [        US   US   SS5      n[        US   5      S-   U-   nSnX4$ [        R
                  " SU5      (       a  UnSnX4$ )Nr   r   Tr   !r   ^=?[^!]+!\$?[A-Z]+\$?\d+)r8  r9  r   r   rematch)r^   rg   rh   cells       r`   r   Chart._process_namesj  s~     $%%(a$q'4F.tAw7#=D !! 5t<<#!!rb   c                    Ub  [        U5      S:X  a  g[        US   [        5      (       a  gU HG  nUc  M  [        U[        5      (       a  [        R
                  " SU5      (       a    g [        U5        MI     g! [         a       gf = f)Nr   r   	multi_strz[_ ]strnum)r   r8  r9  rD  r>  searchfloat
ValueError)r^   r   tokens      r`   _get_data_typeChart._get_data_typez  s     <3t9>d1gt$$ E} %%%"))FE*B*Be "   s   +A;;
B	B	c                 \   U(       d  g UR                  S5      (       a  UR                  S5      nXR                  ;  a@  [        U R                  5      nU R                  R                  U5        X0R                  U'   U$ U R                  U   nU R                  U   c  X R                  U'   U$ )N=)
startswithlstripr+   r   r,   r   )r^   r  r   
formula_ids       r`   r   Chart._get_data_id  s      c""nnS)G ***T../J$$T*(2W%  ))'2J   ,404!!*-rb   c                 |   U(       d  g [         R                  " U5      nSSSSSSSSSS	S	S
SSS.nUR                  S5      nUb  X2;   a  X#   US'   O[        SU 35        g [        R
                  " UR                  S5      5      nSU;   a  [        R
                  " US   5      n[        R                  " UR                  S5      5      n[        R                  " UR                  S5      5      n[        R                  " UR                  S5      5      nU(       a  S U l	        U(       a  S nS nXAS'   XQS'   XaS'   XqS'   U$ )N	automaticr   squarediamondtrianglexstardotdashcirclepluspicture)rS  r   rT  rU  rV  rW  rX  rY  
short_dashrZ  	long_dashr[  r\  r]  typezUnknown marker type 'rl   rm   r]   rn   ro   )
r   deepcopyr   r   r	   r   r   r   r   r]   )r^   rp   typesmarker_typerl   r]   rn   ro   s           r`   r   Chart._get_marker_properties  sQ     v& % " 
$ jj("#!&!3v,[M:; ))&**V*<= v--fX.>?D ))&**V*<= //

90EF 11&**Z2HI DI GDvv#y%zrb   c                    U(       d  g [         R                  " U5      nSSSSSSS.nUR                  S5      nX2;   a  X#   US'   O[        S	U S
35        g [        R
                  " UR                  S5      5      nSU;   a  [        R
                  " US   5      n[        R                  " UR                  S5      5      n[        R                  " UR                  S5      5      n[        R                  " UR                  S5      5      nU R                  UR                  S5      5      nU(       a  S U l
        U(       a  S nS nXAS'   XQS'   XaS'   XqS'   XS'   U$ )Nexplinearlog	movingAvgpolypower)exponentialrg  rh  moving_average
polynomialrk  r`  zUnknown trendline type 'r   rl   rm   r]   rn   ro   label)r   ra  r   r   r	   r   r   r   r   _get_trendline_label_propertiesr]   )	r^   rq   rb  
trend_typerl   r]   rn   ro   ro  s	            r`   r   Chart._get_trendline_properties  s\     MM),	 !) 
 ]]6*
 % 1If+J<q9: )))--*?@ y --i.ABD )))--*?@ //	i0HI 11)--
2KL 44Y]]75KL DI GD & &&) (*"'rb   c                 D   U(       d  0 $ [         R                  " U5      nU R                  UR                  S5      5      n[        R
                  " UR                  S5      5      nSU;   a  [        R
                  " US   5      n[        R                  " UR                  S5      5      n[        R                  " UR                  S5      5      n[        R                  " UR                  S5      5      nU(       a  S U l	        U(       a  S nS nX!S'   X1S'   XAS'   XQS'   XaS'   U$ )Nr   rl   rm   r]   rn   ro   )
r   ra  r   r   r	   r   r   r   r   r]   )r^   ro  r   rl   r]   rn   ro   s          r`   rp  %Chart._get_trendline_label_properties=  s    I e$ &&uyy'89 ))%))F*;< u--eHo>D ))%))F*;< //		)0DE 11%))J2GH DI GDfff"i$jrb   c                    U(       d  0 $ SSSSS.nSSSSSS	.nUS
   nXC;   a  X4   US
'   O[        SU 35        0 $ SU;   a  US   US'   SU;   a  US   US'   SU;   a  US   S:X  a  SUS'   OUS   S:X  a  SUS'   O UR                  S5      US'   UR                  S5      US'   UR                  S5      US'   UR                  S5      US'   [        R                  " UR                  S5      5      US'   U$ )NfixedValr   both)r`  valueendcap	direction
percentagestdDevstdErrcust)fixedr{  standard_deviationstandard_errorcustomr`  zUnknown error bars type 'rx  	end_stylery  rz  minusr\  plus_valuesminus_values	plus_data
minus_datarl   )r   r   r	   r   )r^   r   r   rb  
error_types        r`   r   Chart._get_error_bars_propsj  sI   I )1PVW
  &"*&
 V_
!&!2Jv,ZL9:I g")'"2Jw '!#*;#7Jx  '!{#w.*1
;'%/*0
;'  %,KK$>
=!%,[[%@
>"")++k":
;#*;;|#<
<  #77F8KL
6rb   c                 |    SUR                  S5      0n[        R                  " UR                  S5      5      US'   U$ )Nr  rl   )r   r	   r   )r^   r   gridlines      r`   r#  Chart._get_gridline_properties  s<     w{{956 !55gkk&6IJrb   c                    U(       d  g [         R                  " U5      nUR                  S5      nU(       aG  X R                  ;   a(  X R                  :X  a  S US'   O#U R                  U   US'   O[        SU S35        g UR                  S5      nSSSSS	S
.nU(       a  X4;   a  XC   US'   O[        S5        g U R                  UR                  S5      5      US'   [        R                  " UR                  S5      5      nSU;   a  [        R                  " US   5      n[        R                  " UR                  S5      5      n[        R                  " UR                  S5      5      n[        R                  " UR                  S5      5      nU(       a  S U l        U(       a  S nS nXQS'   XaS'   XqS'   XS'   UR                  S5      (       Ga  US    GH  n	U	c  M	  U	R                  S5      n
U
(       a)  [        R                  " S[        U
5      5      (       a  XS'   U	R                  S5      nU(       a*  UR!                  S5      (       a  UR#                  S5      U	S'   U R%                  XR                  S5      5      nXS'   U R                  U	R                  S5      5      U	S'   [        R                  " U	R                  S5      5      nSU	;   a  [        R                  " U	S   5      n[        R                  " U	R                  S5      5      n[        R                  " U	R                  S5      5      n[        R                  " U	R                  S5      5      nU(       a  S U l        U(       a  S nS nXYS'   XiS'   XyS'   XS'   GM     U$ )Nr  zUnsupported label position 'z' for this chart type	separatorz, z; z. 
r7  ),;.r  r7  zUnsupported label separatorr   rl   rm   r]   rn   ro   r  rx  r=  r  rM  r   r   )r   ra  r   rV   rW   r   r   r	   r   r   r   r   r]   r>  r?  rD  rN  rO  r   )r^   r}   r  r  
separatorsrl   r]   rn   ro   ro  rx  r  r   s                r`   r   Chart._get_labels_properties  s9     v& ::j)///:::)-F:&)-)=)=h)GF:&3H:=RST JJ{+	

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

90EF 11&**Z2HI DI GDvv#y%z::h)=		'*RXX&A3u:NN',)$))I.w11#66'.~~c':E)$++GYYv5FG#*i  $ 7 7		&8I Jf 11%))F2CD u$ 55eHoFD 11%))F2CD  77		)8LM !99%))J:OP  $DI "GD $f $f#*i $,j![ *^ rb   c                 ,   0 n[         R                  " UR                  S5      5      nUR                  S5      (       a  [         R                  " US   5      n[         R                  " UR                  S5      5      n[         R                  " UR                  S5      5      n[         R
                  " UR                  S5      5      nU(       a  S U l        U(       a  S nS nU R                  UR                  S5      S5      nX2S'   XBS'   XRS'   XrS'   XbS'   U$ )Nrl   rm   r]   rn   ro   r   F)r	   r   r   r   r   r   r]   r   )r^   r   arearl   r]   rn   ro   r   s           r`   r   Chart._get_area_properties%  s     ))'++f*=> ;;x  --gh.?@D ))'++f*=> //I0FG 11'++j2IJ DI GD ,,W[[-BEJVV!YX#Zrb   c                 L   0 nUc  0 nUR                  SS5      US'   UR                  S5      US'   U R                  UR                  S5      5      US'   U R                  UR                  S5      S5      US'   UR                  S5      (       a  SUS'   [        R                  " UR                  S5      5      nUR                  S	5      (       a  [        R                  " US	   5      n[        R
                  " UR                  S
5      5      n[        R                  " UR                  S5      5      n[        R                  " UR                  S5      5      nU(       a  S U l        U(       a  S nS nU R                  UR                  S5      S5      nX2S'   XBS
'   XRS'   XrS'   XbS'   U$ )Nr  rightdelete_seriesr   r   Fr   rl   rm   r]   rn   ro   )	r   r   r   r	   r   r   r   r   r]   )r^   r   r(   rl   r]   rn   ro   r   s           r`   r   Chart._get_legend_propertiesM  s   ?G$[[W=z")++o">00V1DEv66w{{87LeTx ;;v!'F: ))'++f*=> ;;x  --gh.?@D ))'++f*=> //I0FG 11'++j2IJ DI GD ,,W[[-BEJvv#y!x%zrb   c           	         0 nU(       d  0 $ U(       a  SnOSnUR                  5        H  nXT;  d  M
  [        SU S35        0 s  $    U Ha  nXaR                  5       ;  a  [        SU S35        0 s  $ X   n [        U5        US:  d  US	:  a  [        SU SU S
35        0 s  $ US X6'   Mc     U$ ! [         a    [        SU SU S35        0 s s  $ f = f)N)rW  y)rW  r  r;   r<   z
Property 'z!' not supported in layout optionsz%' must be specified in layout optionsz	' value 'z' must be numeric in layoutr   r   z/' must be in range 0 < x <= 1 in layout optionsz.17g)keysr   rG  rH  )r^   argsis_textr   
propertieskeyproprx  s           r`   r   Chart._get_layout_properties  s   I#J6J 99;C$z#&GHI	  D99;&z$'LMN	JEe
 qyEAI iw 73 4 	 $D\FL+ .   z$y7RST	s   7B00CCc                    / nU(       d  / $ U H  n0 nUb  [         R                  " UR                  S5      5      nSU;   a  [         R                  " US   5      n[         R                  " UR                  S5      5      n[         R                  " UR                  S5      5      n[         R
                  " UR                  S5      5      nU(       a  S U l        U(       a  S nS nXTS'   XdS'   XtS'   XS'   UR                  U5        M     U$ )Nrl   rm   r]   rn   ro   )r	   r   r   r   r   r   r]   r   )	r^   user_pointsru   
user_pointpointrl   r]   rn   ro   s	            r`   r   Chart._get_points_properties  s    I%JE%11*..2HI z) 55j6JKD 11*..2HI  77
y8QR !99*..:TU  $DI "GD $f $f#*i $,j!MM% E &H rb   c                    SnSnUR                  S5      nUR                  S5      nUR                  S5      (       a  US   S   (       a  SnUR                  S5      (       a  US   S   (       a  SnU=(       d    U=(       d    U=(       d    U$ )NFrn   ro   r]   definedTrl   )r   )r^   elementhas_fillhas_linehas_patternhas_gradients         r`   _has_fill_formattingChart._has_fill_formatting  s{    kk),{{:.;;v76?9#=H;;v76?9#=HB8B{BlBrb   c           
      `    U(       d  g SSSSSSSSS	S
.	nX;   a  X!   nU$ [        SU S35        g )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 'r   r   )r^   r	  rb  s      r`   r"  Chart._get_display_units  s[     #$+!3") 1"$

 !!0M
  /a@Arb   c                 V    U(       d  g SSSSS.nX;   a  X!   nU$ [        SU S35        g )Noutinr   cross)outsideinsider   r  zUnknown tick_type 'r   r   )r^   	tick_typerb  s      r`   r%  Chart._get_tick_type  sL     	
 (I
  &yk34rb   c                 j    / nU R                    H   nUS   (       a  M  UR                  U5        M"     U$ Nr4   r   r   )r^   primary_axes_seriesr   s      r`   _get_primary_axes_seriesChart._get_primary_axes_series  s7     kkF)$$#**62 " #"rb   c                 j    / nU R                    H   nUS   (       d  M  UR                  U5        M"     U$ r  r  )r^   secondary_axes_seriesr   s      r`   _get_secondary_axes_series Chart._get_secondary_axes_series   s7     "kkFi  %,,V4 " %$rb   c                    S[        U R                  5      -   nS[        U R                  5      -   [        U R                  5      -   nUS US 3nUS US-   S 3nUS   (       a6  U R                  R                  U5        U R                  R                  U5        US   (       d7  U R                  R                  U5        U R                  R                  U5        g g )Ni  r   04dprimary_axes)r4  r!   r   r%   r$   r   )r^   r  chart_id
axis_countid1id2s         r`   _add_axis_idsChart._add_axis_ids*  s    #dgg,&T^^,,s4==/AA
#z#./#zA~c23MM  %MM  %N#NN!!#&NN!!#& $rb   c                 0   SSS0S.U R                   S'   SSS0S.U R                  S'   SSSSS	.U R                  S'   SSS0S
SS.U R                  S'   U R	                  0 5        U R                  0 5        U R                  0 5        U R                  0 5        g )NGeneralr  r   )r  r  r   r   r   r  )r  r  r  r  r  )r  r  r  r  )r2   r3   r5   r4   r   r   r   r   r   s    r`   r\   Chart._set_default_properties:  s     $ )1~#
J $ )1~#
J $$	$
Z  $ )1~	$
Z  	rb   c                 `    SnUS-   nUS-   nUS-   nSU4SU4SU4/nU R                  SU5        g )	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   Chart._write_chart_spacea  s[    51100>>    

 	NJ7rb   c                 6    SnSU4/nU R                  SU5        g )Nen-USvalzc:lang_xml_empty_tagr^   r  r  s      r`   r   Chart._write_langp  s"    cl^
Hj1rb   c                 X    U R                   nUS:X  a  g SU4/nU R                  SU5        g )Nr   r  zc:style)r#   r  )r^   r#   r  s      r`   r   Chart._write_stylex  s4    == q=h'(
Iz2rb   c                    U R                  S5        U R                  (       a  U R                  5         OU R                  bI  U R	                  U R                  U R
                  S U R                  U R                  U R                  5        OJU R                  b=  U R                  U R                  S U R                  U R                  U R                  5        U R                  5         U R                  5         U R                  5         U R                  5         U R                  (       a  U R!                  5         U R#                  S5        g )Nzc:chart)r  rR   _write_c_auto_title_deletedrN   _write_title_formularO   rL   rP   rQ   rM   _write_title_rich_write_plot_area_write_legend_write_plot_vis_only_write_disp_blanks_asr8   _write_c_ext_lst_display_nar   r   s    r`   r   Chart._write_chart  s   I&??,,. !!-))&&&&OO%%&& ,&&OOOO%%&& 	 	 	!!# 	""$   ,,.)$rb   c                 X    U R                   nUS:X  a  g SU4/nU R                  SU5        g )Nr   r  zc:dispBlanksAs)r7   r  r  s      r`   r  Chart._write_disp_blanks_as  s5     %<cl^
,j9rb   c                    U R                  S5        U R                  U R                  R                  S5      S5        U R	                  SS05        U R	                  SS05        U R
                  nU(       a  UR                  (       a  SU R                  -   Ul        OU R                  Ul        U R                  Ul        U R                  Ul	        UR	                  SS05        UR	                  SS05        U R                  U R                  U R                  S.nU R                  (       a  U R                  U5        OU R                  U5        U R!                  U5        U R"                  U R$                  U R&                  S.nU R!                  U5        U(       aF  UR                  (       a5  UR"                  UR$                  UR&                  S.nUR!                  U5        U R                  (       a  U R                  U5        OU R                  U5        U R)                  5         U R+                  U R                  5        U R-                  S5        g )	Nz
c:plotArear   plotr  TF  )r2   r3   r$   )r  _write_layoutr1   r   _write_chart_typerY   rZ   r!   fhr"   r2   r3   r$   rS   _write_date_axis_write_cat_axis_write_val_axisr5   r4   r%   _write_d_tabler   r   )r^   second_chartr  s      r`   r  Chart._write_plot_area  s   L) 	4==,,X6? 	5667 }}(("&."&'' #ggLO )-(9(9L% **ND+AB**NE+BC ++$--X!!$'  &T" llll
 	T" L55&..&..(22D ((.!!$'  & 	 	$--(,'rb   c                     U(       d  U R                  S5        g U R                  S5        U R                  X5        U R                  S5        g )Nc:layout)r  r  _write_manual_layoutr   r^   r   layout_types      r`   r  Chart._write_layout  sA     
+ 
+%%f:j)rb   c                    U R                  S5        US:X  a  U R                  SS/5        U R                  SS/5        U R                  SS/5        U R                  SS	US
   4/5        U R                  SS	US   4/5        US:w  a0  U R                  SS	US   4/5        U R                  SS	US   4/5        U R                  S5        g )Nzc:manualLayoutr  zc:layoutTarget)r  innerzc:xMode)r  edgezc:yModezc:xr  rW  zc:yr  textzc:wr;   zc:hr<   r  r  r   r  s      r`   r  Chart._write_manual_layout  s    ,- &  03C2DE 	I'89I'89EUF3K$8#9:EUF3K$8#9: & w(@'ABx0@(A'BC*+rb   c                     g N r^   r  s     r`   r  Chart._write_chart_type&  s     	rb   c                 2    SU4/nU R                  SU5        g )Nr  z
c:groupingr  r  s      r`   _write_groupingChart._write_grouping,  s    cl^
L*5rb   c                 &    U R                  U5        g r  )
_write_serr^   r   s     r`   _write_seriesChart._write_series2  s    rb   c                    U R                   nU =R                   S-  sl         U R                  S5        U R                  U5        U R                  U5        U R	                  U5        U R                  U5        U R                  US   5        U R                  US   5        U R                  US   5        U R                  US   5        U R                  US   5        U R                  US   5        U R                  U5        U R                  U5        U R                  (       a  U R                  US	   5        UR!                  S
5      (       a  U R#                  US
   5        U R%                  S5        g )Nr   zc:serrp   r~   ru   r}   rq   r   rr   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_valrK   _write_c_smoothr   _write_c_ext_lst_inverted_colorr   )r^   r   indexs      r`   r  Chart._write_ser6  sV   !!QG$ 	 	%  	' 	&! 	6(+, 	(()@A 	)* 	6(+, 	f[12 	vl34 	 	   !12 ::&''008H1IJ'"rb   r)  c                 `   SnSnSU4SU4/nSU4/nU R                  S5        U R                  SU5        U R                  S5        U R                  SU5        U R                  S	U05        U R                  S5        U R                  S5        U R                  S5        U R                  S5        g )
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)  r4  
xmlns_c_14attributes1attributes2s         r`   r0  %Chart._write_c_ext_lst_inverted_colork  s     7Q
 CL*%

 $Z01J'G[145J4  '5!12*%23'"*%rb   c                    SnSnSU4SU4/nS/nU R                  S5        U R                  SU5        U R                  S5        U R                  S	U5        U R                  S5        U R                  S5        U R                  S5        g )
Nz&{56B9EC1D-385E-4148-901F-78D8002777C0}z9http://schemas.microsoft.com/office/drawing/2017/03/chartr4  zxmlns:c16r3r  r   r5  r6  zc16r3:dataDisplayOptions16zc16r3:dispNaAsBlankr  )r^   r4  
xmlns_c_16r9  r:  s        r`   r  !Chart._write_c_ext_lst_display_na  s     7P
 CLJ'

 "lJ'G[1891;?67'"*%rb   c                 2    SU4/nU R                  SU5        g )Nr  zc:idxr  r  s      r`   r$  Chart._write_idx       cl^
GZ0rb   c                 2    SU4/nU R                  SU5        g )Nr  c:orderr  r  s      r`   r%  Chart._write_order  s     cl^
Iz2rb   c                 x    US   b  U R                  US   US   5        g US   b  U R                  US   5        g g )Nrh   rz   rg   )_write_tx_formula_write_tx_valuer   s     r`   r&  Chart._write_series_name  sJ     .!-""6.#96);LMF^'  0 (rb   c                 :    U(       a  U R                  SS/5        g g )Nzc:smooth)r  1r  )r^   rr   s     r`   r/  Chart._write_c_smooth  s     
\N; rb   c                 f   US   nUS   nS nUb  U R                   U   nU(       d  g U R                  S5        U R                  U5      nUS:X  a  SU l        U R	                  X$U5        O8US:X  a  SU l        U R                  X$5        OSU l        U R                  X$U5        U R                  S5        g )Nre   r|   zc:catrD  FrC  T)r,   r  rJ  r&   _write_str_ref_write_multi_lvl_str_ref_write_num_refr   )r^   r   r  r   r   cat_types         r`   r-  Chart._write_cat  s    &'$$W-D G$ &&t,u#(D x8$#(D ))'8 $(D x8'"rb   c                     US   nUS   nU R                   U   nU R                  S5        U R                  X$S5        U R                  S5        g )Nrd   r{   c:valrE  )r,   r  rP  r   )r^   r   r  r   r   s        r`   r.  Chart._write_val  sT    "'  )G$ 	G51'"rb   c                     U R                  S5        U R                  U5        US:X  a  U R                  U5        OUS:X  a  U R                  U5        U R	                  S5        g )Nzc:numRefrE  rD  r  _write_series_formula_write_num_cache_write_str_cacher   r^   r  r   ref_types       r`   rP  Chart._write_num_ref  sZ    J' 	""7+u!!$'!!$'*%rb   c                     U R                  S5        U R                  U5        US:X  a  U R                  U5        OUS:X  a  U R                  U5        U R	                  S5        g )Nzc:strRefrE  rD  rW  r[  s       r`   rN  Chart._write_str_ref  s\     	J' 	""7+u!!$'!!$'*%rb   c                    U(       d  g U R                  S5        U R                  U5        U R                  S5        [        US   5      nU R                  U5        [	        U5       HJ  nU R                  S5        [        U5       H  u  pVU R                  XV5        M     U R                  S5        ML     U R                  S5        U R                  S5        g )Nzc:multiLvlStrRefzc:multiLvlStrCacher   zc:lvl)r  rX  r   _write_pt_countreversed	enumerate	_write_ptr   )r^   r  r   countcat_datair  s          r`   rO  Chart._write_multi_lvl_str_ref  s     ./ 	""7+01 DHU# H(%h/q( 0 g& ' 	./,-rb   c                 v    UR                  S5      (       a  UR                  S5      nU R                  SU5        g )NrM  zc:f)rN  rO  _xml_data_element)r^   r  s     r`   rX  Chart._write_series_formula$  s3     c""nnS)Gug.rb   c                 ,   U R                  U5        US   (       a=  U R                  U R                  S   5        U R                  U R                  S   5        g U R                  U R                  S   5        U R                  U R                  S   5        g )Nr  r   r   )r  _write_axis_idr$   r%   r  s     r`   _write_axis_idsChart._write_axis_ids-  sx     	4 a 01a 01 q 12q 12rb   c                 2    SU4/nU R                  SU5        g )Nr  zc:axIdr  r  s      r`   rm  Chart._write_axis_id<       cl^
Hj1rb   c                    US   nUS   nUS   nUb  U(       d  g U R                   nU R                  nUR                  S5      (       a  US   nU R                  S5        U R	                  US   5        U R                  UR                  S5      S S S 5        UR                  S5      (       d  U R                  S	5        U R                  XSR                  S5      5        U R                  UR                  S
5      5        U R                  UR                  S5      5        US   b"  U R                  US   US   UUS   US   5        O"US   b  U R                  US   XbS   US   5        U R                  U5        U R                  UR                  S5      5        U R                  UR                  S5      5        U R                  UR                  S5      5        U R!                  U5        U R#                  UR                  S5      5        U R%                  US	   5        U R&                  (       d  UR                  S5      (       aq  UR                  S5      b  UR                  S5      S:X  d	  US   S:X  a!  U R)                  UR                  S5      5        O U R+                  UR                  S5      5        UR                  S5      (       d  U R-                  S	5        U R/                  UR                  S5      5        U R1                  S5        U R3                  UR                  S5      5        U R5                  UR                  S5      5        U R7                  S5        g )Nr2   r3   r$   r  zc:catAxr   r  r  r   r  r  r  r   r   r  rg   r  r  r  r  r  r  r  r  r  r2  r  r  )r)   r-   r   r  rm  _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_axisr:   _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^   r  r2   r3   r$   r  	is_y_axiss          r`   r  Chart._write_cat_axisC  s   hh
# 8))''	 ::j!!j)HI&HQK( 	FJJy14tDzz)$$q! 	Xzz)'<= 	##FJJ/@$AB 	##FJJ/@$AB )(%%y!y!{#}% F^'""v	++>}@U
 	%%f- 	##FJJ/@$AB 	##FJJ/@$AB 	""6::.>#?@ 	&! 	fjj45 	x{+

9 5 5 

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

= 9: 	  % 	##FJJ$?@ 	$$VZZ%@A)$rb   c                    US   nUS   nUS   nUR                  SU R                  5      nU R                  nUb  U(       d  g UR                  S5      =(       d    UnU R                  S5        U R	                  US   5        U R                  UR                  S5      UR                  S5      UR                  S	5      UR                  S
5      5        UR                  S5      (       d  U R                  S5        U R                  XRR                  S5      5        U R                  UR                  S5      5        U R                  UR                  S5      5        US   b"  U R                  US   US   UUS   US   5        O;US   b5  U R                  US   UUR                  S5      UR                  S5      5        U R                  U5        U R                  UR                  S5      5        U R                  UR                  S5      5        U R                  UR                  S5      5        U R!                  U5        U R#                  UR                  S5      5        U R%                  US   5        UR                  S5      b  US   S	:X  d	  US   S:X  a!  U R'                  UR                  S5      5        O U R)                  UR                  S5      5        U R+                  UR                  S5      5        U R-                  UR                  S5      5        U R/                  UR                  S5      5        U R1                  UR                  S5      UR                  S5      5        U R3                  S5        g )Nr2   r3   r$   r  c:valAxr   r  r  r  r
  r  r  r  r  r   r   r  rg   r  r  r  r  r   r  r  r  r  r	  r  )r   r*   r.   r  rm  rt  ru  rv  rw  rx  r  r  _write_number_formatrz  r{  r|  r   r}  r~  r  r  _write_cross_between_write_c_major_unit_write_c_minor_unit_write_disp_unitsr   r  s          r`   r  Chart._write_val_axis  s"   hh
#88J(>(>?''	 8 ::j)5XI&HQK( 	JJy!JJuJJuJJz"		
 zz)$$q! 	Xzz)'<= 	##FJJ/@$AB 	##FJJ/@$AB )(%%y!y!{#}% F^'""v

;'

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

: 67 $$VZZ
%;< 	!!&**_"=> 	  L!9: 	  L!9: 	JJ'4K)L	
 	)$rb   c                    US   nUS   nUS   nUS   =(       d    U R                   nU R                  nUb  U(       d  g UR                  S5      =(       d    UnU R                  S5        U R	                  US   5        U R                  UR                  S5      UR                  S5      UR                  S	5      UR                  S
5      5        UR                  S5      (       d  U R                  S5        U R                  XSR                  S5      5        U R                  UR                  S5      5        U R                  UR                  S5      5        US   b"  U R                  US   US   UUS   US   5        O"US   b  U R                  US   XbS   US   5        U R                  U5        U R                  UR                  S5      5        U R                  UR                  S5      5        U R                  UR                  S5      5        U R!                  U5        U R#                  UR                  S5      5        U R%                  US   5        UR                  S5      b  US   S	:X  d	  US   S:X  a!  U R'                  UR                  S5      5        O U R)                  UR                  S5      5        U R+                  UR                  S5      5        U R-                  UR                  S5      5        U R/                  UR                  S5      5        U R1                  UR                  S5      UR                  S5      5        U R3                  S5        g )Nr2   r3   r$   r  r  r   r  r  r  r
  r  r   r  r  r  r   r   r  rg   r  r  r  r  r  r  r  r  r	  r  )r*   r.   r   r  rm  rt  ru  rv  rw  rx  r  r  r  rz  r{  r|  r   r}  r~  r  r  r  r  r  r  r   r  s          r`   _write_cat_val_axisChart._write_cat_val_axis	  s    hh
#
#=t'='=''	 8 ::j)5XI&HQK( 	JJy!JJuJJuJJz"		
 zz)$$q! 	Xzz)'<= 	##FJJ/@$AB 	##FJJ/@$AB )(%%y!y!{#}% F^'""v	++>}@U
 	!!&) 	##FJJ/@$AB 	##FJJ/@$AB 	""6::.>#?@ 	&! 	fjj45 	x{+ JJz"*j!U*j!U* 

: 67 $$VZZ
%;< 	!!&**_"=> 	  L!9: 	  L!9: 	JJ'4K)L	
 	)$rb   c                    US   nUS   nUS   nUb  U(       d  g U R                   nUR                  S5      =(       d    UnU R                  S5        U R                  US   5        U R	                  UR                  S5      UR                  S5      UR                  S	5      UR                  S
5      5        UR                  S5      (       d  U R                  S5        U R                  XSR                  S5      5        U R                  UR                  S5      5        U R                  UR                  S5      5        US   b"  U R                  US   US   S US   US   5        O#US   b  U R                  US   S US   US   5        U R                  U5        U R                  UR                  S5      5        U R                  UR                  S5      5        U R                  UR                  S5      5        U R                  U5        U R!                  UR                  S5      5        U R#                  US   5        U R$                  (       d  UR                  S5      (       aq  UR                  S5      b  UR                  S5      S	:X  d	  US   S:X  a!  U R'                  UR                  S5      5        O U R)                  UR                  S5      5        U R+                  S5        U R-                  S5        U R/                  UR                  S5      5        U R1                  UR                  S5      5        U R3                  UR                  S5      5        UR                  S5      (       a  U R5                  US   5        U R7                  UR                  S5      5        UR                  S5      (       a  U R9                  US   5        U R;                  S5        g ) Nr2   r3   r$   r  zc:dateAxr   r  r  r  r
  r  r   r  r  r  r   r   r  rg   r  r  r  r  r  r2  r  r  r  r  r  r  )r)   r   r  rm  rt  ru  rv  rw  rx  r  r  r  rz  r{  r|  r   r}  r~  r:   r  r  r  r  r  r  r  _write_c_major_time_unitr  _write_c_minor_time_unitr   )r^   r  r2   r3   r$   r  s         r`   r  Chart._write_date_axisy	  su   hh
# 8)) ::j)5XJ'HQK( 	JJy!JJuJJuJJz"		
 zz)$$q! 	Xzz)'<= 	##FJJ/@$AB 	##FJJ/@$AB )(%%y!y!{#}% F^'""vf[&96-;P
 	!!&) 	##FJJ/@$AB 	##FJJ/@$AB 	""6::.>#?@ 	&! 	fjj45 	x{+

9 5 5 

:&.::j)U2*%. ##FJJz$:; ((J)?@ 	 	  % 	##FJJ$?@ 	$$VZZ%@A 	  L!9: ::l##))&1B*CD 	  L!9: ::l##))&1B*CD*%rb   c                     U R                  S5        U R                  U5        U R                  U5        U R                  U5        U R	                  U5        U R                  S5        g )Nz	c:scaling)r  _write_c_log_base_write_orientation_write_c_max_write_c_minr   )r^   r  min_valmax_valr
  s        r`   rt  Chart._write_scaling	  s`     	K( 	x( 	( 	'" 	'"+&rb   c                 B    U(       d  g SU4/nU R                  SU5        g )Nr  z	c:logBaser  r  s      r`   r  Chart._write_c_log_base	  %     cl^
K4rb   c                 H    SnU(       a  SnSU4/nU R                  SU5        g )NminMaxmaxMinr  zc:orientationr  )r^   r  r  r  s       r`   r  Chart._write_orientation	
  s*    Ccl^
OZ8rb   c                 :    Uc  g SU4/nU R                  SU5        g )Nr  zc:maxr  )r^   r  r  s      r`   r  Chart._write_c_max
  )     ?g&'
GZ0rb   c                 :    Uc  g SU4/nU R                  SU5        g )Nr  zc:minr  )r^   r  r  s      r`   r  Chart._write_c_min
  r  rb   c                 `    U(       a  US:X  a  SnUS:X  a  SnSU4/nU R                  SU5        g )Nr   rr   tr  zc:axPosr  )r^   r  r  r  s       r`   rv  Chart._write_axis_pos(
  s:     czczcl^
Iz2rb   c                     UR                  S5      nSnUb  X!S   S   :w  a  SnUR                  S5      (       a  SnSU4SU4/nU R                  SU5        g 	Nr  r   r   r   r  
formatCodesourceLinkedc:numFmt)r   r  )r^   r   format_codesource_linkedr  s        r`   r  Chart._write_number_format5
  su    
 hh|, "{:6F|6T'TM 88'((M ;']+


 	J
3rb   c                     UR                  S5      nSnSnUb  X!S   S   :w  a  SnSnUR                  S5      (       a  SnU R                  (       d  U(       a  g SU4SU4/nU R                  SU5        g r  )r   r&   r  )r^   r   r  r  default_formatr  s         r`   ry  Chart._write_cat_number_formatL
  s     hh|, "{:6F|6T'TMN 88'((M ## ;']+


 	J
3rb   c                 <    SnSU4SU4/nU R                  SU5        g )Nr   r  r  r  r  )r^   r  r  r  s       r`   _write_data_label_number_format%Chart._write_data_label_number_formatg
  s2     ;']+


 	J
3rb   c                 B    U(       d  g SU4/nU R                  SU5        g )Nr  zc:majorTickMarkr  r  s      r`   rz  Chart._write_major_tick_markr
  &     cl^
-z:rb   c                 B    U(       d  g SU4/nU R                  SU5        g )Nr  zc:minorTickMarkr  r  s      r`   r{  Chart._write_minor_tick_mark|
  r  rb   c                 H    Ub  US:X  a  SnSU4/nU R                  SU5        g )Nnext_tonextTor  zc:tickLblPosr  r  s      r`   r|  Chart._write_tick_label_pos
  s.    ;#*Ccl^
NJ7rb   c                 2    SU4/nU R                  SU5        g )Nr  z	c:crossAxr  r  s      r`   r~  Chart._write_cross_axis
       cl^
K4rb   c                 <    Uc  SnSU4/nU R                  SU5        g )NautoZeror  z	c:crossesr  r  s      r`   r  Chart._write_crosses
  s'    ;Ccl^
K4rb   c                 2    SU4/nU R                  SU5        g )Nr  zc:crossesAtr  r  s      r`   r  Chart._write_c_crosses_at
       cl^
M:6rb   c                 2    SU4/nU R                  SU5        g )Nr  zc:autor  r  s      r`   r  Chart._write_auto
  rr  rb   c                 \    Uc  SnUS:X  a  SnUS:X  a  SnSU4/nU R                  SU5        g )Nctrr  r  leftr   r  z	c:lblAlgnr  r  s      r`   r  Chart._write_label_align
  sA     ;C'>C&=Ccl^
K4rb   c                 2    SU4/nU R                  SU5        g )Nr  zc:lblOffsetr  r  s      r`   r  Chart._write_label_offset
  r  rb   c                 :    Uc  g SU4/nU R                  SU5        g )Nr  zc:tickLblSkipr  r  s      r`   r  Chart._write_c_tick_lbl_skip
  s%    ;cl^
OZ8rb   c                 :    Uc  g SU4/nU R                  SU5        g )Nr  zc:tickMarkSkipr  r  s      r`   r  Chart._write_c_tick_mark_skip
  s&    ;cl^
,j9rb   c                     U(       d  g US   (       d  g US   S   (       a4  U R                  S5        U R                  U5        U R                  S5        g U R                  S5        g )Nr  rl   r  zc:majorGridlinesr  r   r   r  r^   	gridliness     r`   rw  Chart._write_major_gridlines
  _     #VY' 23 i(01 23rb   c                     U(       d  g US   (       d  g US   S   (       a4  U R                  S5        U R                  U5        U R                  S5        g U R                  S5        g )Nr  rl   r  zc:minorGridlinesr  r  s     r`   rx  Chart._write_minor_gridlines
  r  rb   c                 P    Uc  U R                   nSU4/nU R                  SU5        g )Nr  zc:crossBetween)rB   r  r  s      r`   r  Chart._write_cross_between
  s.    ;$$Ccl^
,j9rb   c                 B    U(       d  g SU4/nU R                  SU5        g )Nr  zc:majorUnitr  r  s      r`   r  Chart._write_c_major_unit  %     cl^
M:6rb   c                 B    U(       d  g SU4/nU R                  SU5        g )Nr  zc:minorUnitr  r  s      r`   r  Chart._write_c_minor_unit  r  rb   c                 <    Uc  SnSU4/nU R                  SU5        g )Ndaysr  zc:majorTimeUnitr  r  s      r`   r  Chart._write_c_major_time_unit  (    ;Ccl^
-z:rb   c                 <    Uc  SnSU4/nU R                  SU5        g )Nr  r  zc:minorTimeUnitr  r  s      r`   r  Chart._write_c_minor_time_unit"  r  rb   c                    U R                   nUR                  SS5      nUR                  S5      n/ nSnUR                  S5      (       a  [        US   [        5      (       a  US   nUR	                  S5      (       a  UR                  SS5      nSnS	S
SSSS.nUS:X  a  g X&;  a  g Xb   nU R                  S5        U R                  U5        U H  nU R                  U5        M     U R                  UR                  S5      S5        U(       a  U R                  5         U(       a  U R                  U5        U R                  U5        U R                  S5        g )Nr  r  r   r   r  overlay_r   r   r  r   r  r   tr)r  r  topbottom	top_rightr   zc:legendr   r(   )r(   r   r8  r9  rN  replacer  _write_legend_pos_write_legend_entryr  _write_overlay_write_tx_prr   r   )r^   r(   r  r   r  r   allowedr1  s           r`   r  Chart._write_legend+  sN   ::j'2zz&!::o&&:f_6Mt+T+T"?3Mz**''
B7HG 
 v"$J' 	x( #E$$U+ #
 	6::h/: !d# 	&!*%rb   c                 2    SU4/nU R                  SU5        g )Nr  zc:legendPosr  r  s      r`   r  Chart._write_legend_posc  r  rb   c                     U R                  S5        U R                  U5        U R                  S5        U R                  S5        g )Nzc:legendEntryr   )r  r$  ru  r   )r^   r1  s     r`   r  Chart._write_legend_entryj  s>     	O, 	 	1/*rb   c                 6    SnSU4/nU R                  SU5        g )Nr   r  z	c:overlayr  r  s      r`   r  Chart._write_overlayw  "    cl^
K4rb   c                 Z    SnU R                   (       a  g SU4/nU R                  SU5        g )Nr   r  zc:plotVisOnly)r9   r  r  s      r`   r  Chart._write_plot_vis_only  s0     cl^
OZ8rb   c                     U R                  S5        U R                  5         U R                  5         U R                  5         U R	                  S5        g )Nzc:printSettings)r  _write_header_footer_write_page_margins_write_page_setupr   r   s    r`   r   Chart._write_print_settings  sJ    -. 	!!# 	  " 	 +,rb   c                 &    U R                  S5        g )Nzc:headerFooterr  r   s    r`   r  Chart._write_header_footer  s    ,-rb   c                 h    SnSnSnSnSnSnSU4SU4SU4SU4SU4S	U4/nU R                  S
U5        g )Ng      ?gffffff?g333333?r   r   r  r  headerfooterzc:pageMarginsr  )r^   r  r  r  r  r  r  r  s           r`   r	  Chart._write_page_margins  sg     &M$K%L#Jvv

 	OZ8rb   c                 &    U R                  S5        g )Nzc:pageSetupr  r   s    r`   r
  Chart._write_page_setup  s    M*rb   c                 *    U R                  SS/5        g )Nzc:autoTitleDeletedr=  r  r   s    r`   r  !Chart._write_c_auto_title_deleted  s    0:,?rb   c                     U R                  S5        U R                  XU5        U R                  US5        U(       a  U R                  5         U R	                  S5        g Nzc:titler  )r  _write_tx_richr  r  r   )r^   titler  r   r   r   s         r`   r  Chart._write_title_rich  sU     	I& 	Ed3 	66* !)$rb   c                     U R                  S5        U R                  X5        U R                  US5        U(       a  U R                  5         U R	                  XC5        U R                  S5        g r  )r  rG  r  r  r  r   )r^   r  r   r  r   r   r   s          r`   r  Chart._write_title_formula  sc    
 	I& 	u. 	66* ! 	$*)$rb   c                 j    U R                  S5        U R                  XUSS9  U R                  S5        g )Nc:txF)ignore_rich_pr)r  _write_richr   )r^   r  r  r   s       r`   r  Chart._write_tx_rich  s7     	F# 	iF&!rb   c                 j    U R                  S5        U R                  U5        U R                  S5        g )Nr  r  _write_vr   r^   r  s     r`   rH  Chart._write_tx_value  s.     	F# 	e&!rb   c                     S nUb  U R                   U   nU R                  S5        U R                  XS5        U R                  S5        g )Nr  rD  )r,   r  rN  r   )r^   r  r   r   s       r`   rG  Chart._write_tx_formula  sK    $$W-DF# 	E/&!rb   c                     U(       a  UR                  S5      b  US   nOS nU R                  S5        U R                  XS5        U R                  5         U R	                  XU5        U R                  S5        g )Nr1  zc:rich)r   r  _write_a_body_pr_write_a_lst_style_write_a_p_richr   )r^   r  r   r  r  r1  s         r`   r   Chart._write_rich  sp     DHHZ(4J'HHH% 	h2 	! 	U.9(#rb   c                 6   / nUc	  U(       a  SnUbv  US:X  a#  UR                  S5        UR                  S5        OMUS:X  a#  UR                  S5        UR                  S5        O$UR                  SU45        UR                  S5        U R                  S	U5        g )
Ni@i@1 )rotr   )vertwordArtVerti )r0  eaVertr/  )r0  horzza:bodyPr)r   r  )r^   r1  r  r  s       r`   r*  Chart._write_a_body_pr  s    
	H8#!!*-!!"9:X%!!*-!!"45!!5("34!!"23J
3rb   c                 &    U R                  S5        g )Nz
a:lstStyler  r   s    r`   r+  Chart._write_a_lst_style.  s    L)rb   c                     U R                  S5        U(       d  U R                  U5        U R                  X5        U R                  S5        g Na:p)r  _write_a_p_pr_rich
_write_a_rr   )r^   r  r   r  s       r`   r,  Chart._write_a_p_rich2  sA     	E" ##D) 	$% rb   c                     U R                  S5        U R                  U5        U R                  5         U R                  S5        g r8  )r  r:  _write_a_end_para_rprr   r^   r   s     r`   _write_a_p_formulaChart._write_a_p_formula@  s>     	E" 	% 	""$% rb   c                 j    U R                  S5        U R                  U5        U R                  S5        g )Nza:pPr)r  _write_a_def_rprr   r?  s     r`   r:  Chart._write_a_p_pr_richM  s0     	G$ 	d#'"rb   c                    Sn[         R                  " U5      n[         R                  " U5      nU(       a  UR                  S5      (       a  SnU(       d  U(       aY  U R	                  SU5        U(       a  U R                  SUS   05        U(       a  U R                  U5        U R                  S5        g U R                  SU5        g )NFr)  Tza:defRPr)	r	   _get_font_style_attributes_get_font_latin_attributesr   r  r7  _write_a_latinr   r  )r^   r   	has_colorstyle_attributeslatin_attributess        r`   rC  Chart._write_a_def_rprW  s    	 ;;DA ;;DADHHW%%Iy
,<=(('4=)AB##$45j)
,<=rb   c                 6    SnSU4/nU R                  SU5        g )Nr  langza:endParaRPrr  )r^   rN  r  s      r`   r>  Chart._write_a_end_para_rprn  s#    tn%
NJ7rb   c                     U R                  S5        U R                  U5        U R                  U5        U R                  S5        g )Nza:r)r  _write_a_r_pr
_write_a_tr   )r^   r  r   s      r`   r;  Chart._write_a_rv  s>     	E" 	4  	% rb   c                    SnSn[         R                  " U5      n[         R                  " U5      nU(       a  US   (       a  SnUR                  SSU45        U(       d  U(       aY  U R	                  SU5        U(       a  U R                  SUS   05        U(       a  U R                  U5        U R                  S5        g U R                  SU5        g )NFr  r)  Tr   rN  za:rPr)	r	   rF  rG  insertr  r7  rH  r   r  )r^   r   rI  rN  rJ  rK  s         r`   rQ  Chart._write_a_r_pr  s    	 ;;DA ;;DADMI 	FD>2y)9:(('4=)AB##$45g&)9:rb   c                 (    U R                  SU5        g )Nza:trj  r%  s     r`   rR  Chart._write_a_t  s     	ue,rb   c                     U(       a  UR                  S5      b  US   nOS nU R                  S5        U R                  X25        U R                  5         U R	                  U5        U R                  S5        g )Nr1  c:txPr)r   r  r*  r+  r@  r   )r^   r   r  r1  s       r`   r  Chart._write_tx_pr  sn     DHHZ(4J'HHH% 	h2 	! 	%(#rb   c                 (   Uc  U R                   nU(       d  g US   S:X  a  g U R                  S5        U R                  US   5        UR                  S5      (       a  U R	                  US   5        U R                  U5        U R                  S5        g )Nr`  rS  zc:markerr*  )rC   r  _write_symbolr   _write_marker_sizer   r   )r^   rp   s     r`   r'  Chart._write_marker  s    >((F&>[(J' 	6&>* ::f##F6N3 	&!*%rb   c                 2    SU4/nU R                  SU5        g )Nr  zc:sizer  r  s      r`   r_  Chart._write_marker_size  rr  rb   c                 2    SU4/nU R                  SU5        g )Nr  zc:symbolr  r  s      r`   r^  Chart._write_symbol       cl^
J
3rb   c                 .   U R                  U5      (       d  g U R                  S5        UR                  S5      (       a;  US   S   (       a.  SUS   ;   a  U R                  5         OU R	                  US   5        UR                  S5      (       a  U R                  US   5        UR                  S5      (       a  U R                  US   5        UR                  S5      (       a!  US   S   (       a  U R                  US   5        U R                  S5        g )Nc:spPrr]   r  r   rn   ro   rl   )	r  r  r   _write_a_no_fillr7  _write_a_patt_fill_write_a_grad_fill_write_a_lnr   r   s     r`   r   Chart._write_sp_pr  s     ((00H% ::f&.";'%%' ((8::i  ##F9$56::j!!##F:$67 ::f&.";VF^,(#rb   c                 "   / nUR                  S5      nUb*  [        US-   S-  5      S-  n[        SSU-  -   5      nSU4/nUR                  S5      (       d,  UR                  S	5      (       d  UR                  S
5      (       a{  U R                  SU5        SU;   a  U R                  5         OS	U;   a  U R	                  U5        UR                  S
5      nU(       a  U R                  U5        U R                  S5        g U R                  SU5        g )Nr;   g      ?   g      @g      ?i1  wr   r)  	dash_typeza:ln)r   r4  r  rh  r7  _write_a_prst_dashr   r  )r^   rl   r  r;   	line_types        r`   rk  Chart._write_a_ln  s    
 !!+,s2E uu}-.E,J88Ftxx00DHH[4I4I
3 ~%%'D((. -I''	2f%
3rb   c                 &    U R                  S5        g )Nza:noFillr  r   s    r`   rh  Chart._write_a_no_fill#  s    J'rb   c                     U R                  S5        UR                  S5      (       a$  U R                  US   UR                  S5      5        U R                  S5        g )Nza:solidFillr)  transparency)r  r   _write_colorr   )r^   r]   s     r`   r7  Chart._write_a_solid_fill'  sL     	M*88Gd7mTXXn-EF-(rb   c                    U(       d  g UR                   (       a  U R                  5         g UR                  [        R                  :X  a  U R                  X5        g UR                  [        R                  :X  a  U R                  X5        g g r  )_is_automatic_write_a_sys_clr_typer   RGB_write_a_srgb_clrTHEME_write_a_scheme_clr)r^   r)  rw  s      r`   rx  Chart._write_color1  sb     !!#[[JNN*""57[[J,,,$$U9 -rb   c                 @    SnSnSU4SU4/nU R                  SU5        g )NwindowFFFFFFr  lastClrza:sysClrr  )r^   r  last_clrr  s       r`   r|  Chart._write_a_sys_clr@  s8      CL!


 	J
3rb   c                     U(       d  g SUR                  5       4/nU(       a5  U R                  SU5        U R                  U5        U R                  S5        g U R	                  SU5        g )Nr  z	a:srgbClr)_rgb_hex_valuer  _write_a_alphar   r  )r^   r)  rw  r  s       r`   r  Chart._write_a_srgb_clrM  sa     e22456
Z8 -k*Z8rb   c                 R   UR                  5       u  p4nSU4/nUS:  d  US:  d  U(       aj  U R                  SU5        US:  a  U R                  U5        US:  a  U R                  U5        U(       a  U R	                  U5        U R                  S5        g U R                  SU5        g )Nr  r   za:schemeClr)_chart_schemer  _write_a_lum_mod_write_a_lum_offr  r   r  )r^   r)  rw  schemelum_modlum_offr  s          r`   r  Chart._write_a_scheme_clr_  s    #(#6#6#8 fo&
Q;'A+z:{%%g.{%%g.##L1m,z:rb   rx  c                 2    SU4/nU R                  SU5        g )Nr  za:lumModr  r^   rx  r  s      r`   r  Chart._write_a_lum_modw      en%
J
3rb   c                 2    SU4/nU R                  SU5        g )Nr  za:lumOffr  r  s      r`   r  Chart._write_a_lum_off}  r  rb   c                 f    [        S[        U5      -
  S-  5      nSU4/nU R                  SU5        g )Nr2  r   r  za:alphar4  r  r  s      r`   r  Chart._write_a_alpha  s6     3S>T)*cl^
Iz2rb   c                 2    SU4/nU R                  SU5        g )Nr  z
a:prstDashr  r  s      r`   rq  Chart._write_a_prst_dash  s     cl^
L*5rb   c                    U(       d  g U R                  S5        U R                  UR                  S5      5        U R                  U5        U R	                  US   5        US   S:X  a   U R                  UR                  S5      5        US   S:X  a   U R                  UR                  S5      5        U R                  UR                  S5      5        U R                  UR                  S	5      5        S
U;   a  U R                  US
   5        UR                  S5      (       a  U R                  5         UR                  S5      (       a!  U R                  5         U R                  U5        U R                  S5        g )Nzc:trendlinerg   r`  rj  orderri  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^   rq   s     r`   r+  Chart._write_trendline  sE    M* 	v./ 	)$ 	""9V#45 V&''	g(>? V+y}}X67 	IMM)45 	Y]]:67)###Ik$:;==,--##%==+,,!!# ''	2-(rb   c                 2    SU4/nU R                  SU5        g )Nr  zc:trendlineTyper  r  s      r`   r  Chart._write_trendline_type  s      cl^
-z:rb   c                 0    Uc  g U R                  SU5        g )Nzc:namerX  r^   r   s     r`   r  Chart._write_name  s     <x.rb   c                 J    [        US5      nSU4/nU R                  SU5        g )Nr   r  rD  r  r  r  s      r`   r  Chart._write_trendline_order  s(    #qkcl^
Iz2rb   c                 J    [        US5      nSU4/nU R                  SU5        g )Nr   r  zc:periodr  r  s      r`   r  Chart._write_period  s(    #qkcl^
J
3rb   c                 B    U(       d  g SU4/nU R                  SU5        g )Nr  z	c:forwardr  r  s      r`   r  Chart._write_forward  r  rb   c                 B    U(       d  g SU4/nU R                  SU5        g )Nr  z
c:backwardr  r  s      r`   r  Chart._write_backward  s%     cl^
L*5rb   c                 2    SU4/nU R                  SU5        g )Nr  zc:interceptr  r  s      r`   r  Chart._write_c_intercept  s    cl^
M:6rb   c                 .    S/nU R                  SU5        g )Nr=  zc:dispEqr  r^   r  s     r`   r  Chart._write_c_disp_eq  s     \
J
3rb   c                 .    S/nU R                  SU5        g )Nr=  z
c:dispRSqrr  r  s     r`   r  Chart._write_c_disp_rsqr       \
L*5rb   c                     U R                  S5        U R                  S S 5        U R                  5         U R                  US   5        US   (       a,  US   R	                  S5      nU(       a  U R                  U5        U R                  S5        g )Nzc:trendlineLblro  r   )r  r  _write_trendline_num_fmtr   r   r}  r   )r^   rq   r   s      r`   r  Chart._write_c_trendline_lbl  s    ,- 	4& 	%%' 	)G,- WW%))&1D%%d+*+rb   c                 0    SS/nU R                  SU5        g )N)r  r  )r  r   r  r  r  s     r`   r  Chart._write_trendline_num_fmt  s#     &


 	J
3rb   c                     U R                   nUc  g SU;   aA  US   S   (       a4  U R                  S5        U R                  U5        U R                  S5        g U R	                  S5        g )Nrl   r  zc:hiLowLines)rI   r  r   r   r  )r^   rI   s     r`   _write_hi_low_linesChart._write_hi_low_lines&  sd    ((\!l6&:9&E/ l+n-/rb   c                     U R                   nUc  g US   S   (       a4  U R                  S5        U R                  U5        U R                  S5        g U R	                  S5        g )Nrl   r  zc:dropLines)rH   r  r   r   r  )r^   rH   s     r`   _write_drop_linesChart._write_drop_lines7  s[    __
fi(. j)m,.rb   c                 :    Uc  g SU4/nU R                  SU5        g )Nr  z	c:overlapr  r  s      r`   _write_overlapChart._write_overlapH  s'     ;cl^
K4rb   c                 J   U(       a  [        U5      nOSnU R                  S5        U R                  S5        U R                  U5        [	        U5       H)  nX   nUc  M   [        U5        U R                  X45        M+     U R                  S5        g ! [         a    Sn N5f = f)Nr   z
c:numCacher  	r   r  _write_format_codera  rangerG  rH  rd  r   r^   r   re  rg  rI  s        r`   rY  Chart._write_num_cacheR  s    IEEL) 		* 	U#uAGE}e NN1$  	,'  s   !BB"!B"c                     [        U5      nU R                  S5        U R                  U5        [        U5       H  nU R	                  X1U   5        M     U R                  S5        g )Nz
c:strCache)r   r  ra  r  rd  r   )r^   r   re  rg  s       r`   rZ  Chart._write_str_cacher  sW    D	L) 	U#uANN11g&  	,'rb   c                 (    U R                  SU5        g )Nzc:formatCoderX  r  s     r`   r  Chart._write_format_code  s     	~t4rb   c                 2    SU4/nU R                  SU5        g )Nr  z	c:ptCountr  r  s      r`   ra  Chart._write_pt_count  r  rb   c                 ~    Uc  g SU4/nU R                  SU5        U R                  U5        U R                  S5        g )Nidxzc:ptr#  )r^   r  rx  r  s       r`   rd  Chart._write_pt  sC     =cl^
FJ/ 	e&!rb   c                 (    U R                  SU5        g )Nzc:vrX  r  s     r`   r$  Chart._write_v  s     	ud+rb   c                 J    U R                   (       d  g U R                  S5        g )Nzc:protection)r/   r  r   s    r`   r   Chart._write_protection  s    N+rb   c                 h    SnU(       d  g U H"  nUS-  nU(       d  M  U R                  X#5        M$     g )Nr   r   )_write_d_pt_point)r^   ru   r1  r  s       r`   r)  Chart._write_d_pt  s4    EQJE""50 rb   c                     U R                  S5        U R                  U5        U R                  U5        U R                  S5        g )Nzc:dPt)r  r$  r   r   )r^   r1  r  s      r`   r  Chart._write_d_pt_point  s>     	G$ 	 	% '"rb   c                    U(       d  g U R                  S5        UR                  S5      (       a  U R                  XS   5        UR                  S5      (       a  U R                  US   5        U R	                  U5        UR                  S5      (       a  U R                  US   5        UR                  S5      (       a  U R                  US   5        UR                  S5      (       a  U R                  5         UR                  S5      (       a  U R                  5         UR                  S5      (       a  U R                  5         UR                  S	5      (       a  U R                  5         UR                  S
5      (       a  U R                  5         UR                  S5      (       a  U R                  US   5        UR                  S5      (       a  U R                  5         U R                  S5        g )Nzc:dLblsr  r  r   r  
legend_keyrx  categoryseries_namer{  r  leader_lines)r  r   _write_custom_labelsr  r   r}  _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*  Chart._write_d_lbls  s    I& ::h%%fX.>? ::l##001EF 	&! ::f!!&.1 ::j!!!!&"45 ::l##'') ::g  " ::j!!%%' ::m$$%%' ::l##$$& ::k""!!&"56 ::n%%))+)$rb   c                 &   SnU GH  nUS-  nUc  M  U R                  S5        U R                  US-
  5        UR                  S5      nU(       a  U R                  S5        GOUR                  S5      (       a  U R	                  U5        UR                  S5      (       a  U R                  US   5        UR                  S5      (       a  U R                  5         UR                  S5      (       a  U R                  5         UR                  S	5      (       a  U R                  5         OUR                  S5      (       a  U R                  U5        UR                  S5      (       a  U R                  US   5        UR                  S5      (       a  U R                  5         UR                  S5      (       a  U R                  5         UR                  S	5      (       a  U R                  5         OU R                  U5        U R                  S5        GM     g )
Nr   r   zc:dLbldeleter  r  rx  r  r  )r  r$  r   ru  _write_custom_label_formular  r  r  r  _write_custom_label_str_write_custom_label_format_onlyr   )r^   parentr}   r1  ro  delete_labels         r`   r  Chart._write_custom_labels  s   EQJE}) OOEAI& 99X.L""1%9%%007::j))))&*<=::g&&((*::j))--/::m,,--/7##,,U3::j))))&*<=::g&&((*::j))--/::m,,--/44U;h'Y rb   c                 $   UR                  S5      nUR                  S5      nU R                  U5      nU R                  S S 5        U R                  S5        U R	                  X#SU(       + 5        U R                  S5        U R                  U5        g )Nrx  r   r  F)r   r  r  r  r   r   r   )r^   ro  r  r   has_formattings        r`   r  Chart._write_custom_label_str.  s    		'"yy 2259 	4&F# 	e-?@&! 	% rb   c                    UR                  S5      nUR                  S5      nS nUb  U R                  U   nU R                  S S 5        U R                  S5        U R	                  X$S5        U R                  S5        U R                  U5        g )Nr  r   r  rD  )r   r,   r  r  rN  r   r  )r^   ro  r  r   r   s        r`   r   !Chart._write_custom_label_formulaA  s    ))I&))I&$$W-D 	4&F# 	G51&! 	,,U3rb   c                     UR                  S5      nU R                  U5      nU(       a#  U R                  U5        U R                  U5        g U(       a#  U R	                  S5        U R                  U5        g g )Nr   rg  )r   r  r   r  r  )r^   ro  r   r  s       r`   r  %Chart._write_custom_label_format_onlyW  sc    yy 2259e$d#)d# rb   c                 6    SnSU4/nU R                  SU5        g )NrK  r  zc:showLegendKeyr  r  s      r`   r  Chart._write_show_legend_keyc  s#    cl^
-z:rb   c                 6    SnSU4/nU R                  SU5        g )Nr   r  z	c:showValr  r  s      r`   r  Chart._write_show_valk  r  rb   c                 6    SnSU4/nU R                  SU5        g )Nr   r  zc:showCatNamer  r  s      r`   r  Chart._write_show_cat_names  "    cl^
OZ8rb   c                 6    SnSU4/nU R                  SU5        g )Nr   r  zc:showSerNamer  r  s      r`   r  Chart._write_show_ser_name{  r  rb   c                 6    SnSU4/nU R                  SU5        g )Nr   r  zc:showPercentr  r  s      r`   r  Chart._write_show_percent  r  rb   c                 (    U R                  SU5        g )Nzc:separatorrX  r  s     r`   r  Chart._write_separator  s    }d3rb   c                     SnSnSU4SU4/nU R                  S5        U R                  SU5        U R                  SS/5        U R                  S5        U R                  S5        g )	Nz&{CE6537A1-D6FC-4f65-9D91-7224C49458BB}z6http://schemas.microsoft.com/office/drawing/2012/chartr4  z	xmlns:c15r5  r6  zc15:showLeaderLinesr=  r  )r^   r4  
xmlns_c_15r  s       r`   r  Chart._write_show_leader_lines  su     7M
 CL*%


 	J'GZ01J<@'"*%rb   c                 2    SU4/nU R                  SU5        g )Nr  z	c:dLblPosr  r  s      r`   r  Chart._write_d_lbl_pos  r  rb   c                 2    SU4/nU R                  SU5        g )Nr  zc:deleter  r  s      r`   ru  Chart._write_delete  re  rb   c                 F    SnU(       d  g SU4/nU R                  SU5        g )Nr   r  zc:invertIfNegativer  )r^   invertr  r  s       r`   r(  !Chart._write_c_invert_if_negative  s)    cl^
0*=rb   c                 @   U(       d  g U R                  S5        U R                  UR                  S5      S 5        U R                  5         U R                  S5        U R	                  U5        U R                  5         U R                  S5        U R                  S5        g )Nr[  r1  r9  )r  r*  r   r+  r:  r>  r   r?  s     r`   r}  Chart._write_axis_font  s     H%dhhz2D9!E"%""$% (#rb   c                 (    U R                  SU5        g )Nza:latinr  r  s     r`   rH  Chart._write_a_latin  s    Iz2rb   c                 |   U R                   nU(       d  g U R                  S5        US   (       a  U R                  5         US   (       a  U R                  5         US   (       a  U R	                  5         US   (       a  U R                  5         US   (       a  U R                  US   5        U R                  S5        g )Nzc:dTabler   r   r   r   r   )rA   r  _write_show_horz_border_write_show_vert_border_write_show_outline_write_show_keysr  r   )r^   rA   s     r`   r  Chart._write_d_table  s    

J'((*((*$$&!!#=eFm,*%rb   c                 .    S/nU R                  SU5        g )Nr=  zc:showHorzBorderr  r  s     r`   r)  Chart._write_show_horz_border       \
.
;rb   c                 .    S/nU R                  SU5        g )Nr=  zc:showVertBorderr  r  s     r`   r*  Chart._write_show_vert_border  r0  rb   c                 .    S/nU R                  SU5        g )Nr=  zc:showOutliner  r  s     r`   r+  Chart._write_show_outline  s     \
OZ8rb   c                 .    S/nU R                  SU5        g )Nr=  z
c:showKeysr  r  s     r`   r,  Chart._write_show_keys  r  rb   c                     U(       d  g US   (       a  U R                  SUS   5        US   (       a  U R                  SUS   5        g g )Nrt   rW  rs   r  )_write_err_barsr^   r   s     r`   r,  Chart._write_error_bars  sI     n%  j&@An%  j&@A &rb   c                    U(       d  g U R                  S5        U R                  U5        U R                  US   5        U R                  US   5        US   (       d  U R	                  5         US   S:X  a  O/US   S:X  a  U R                  U5        OU R                  US   5        U R                  U5        U R                  S5        g )Nz	c:errBarsrz  r`  ry  r}  r~  rx  )	r  _write_err_dir_write_err_bar_type_write_err_val_type_write_no_end_cap_write_custom_error_write_error_valr   r   )r^   rz  r   s      r`   r8  Chart._write_err_bars  s     K( 	I& 	  K!89 	  F!34(#""$f)6)$$Z0 !!*W"56 	*%+&rb   c                 2    SU4/nU R                  SU5        g )Nr  zc:errDirr  r  s      r`   r<  Chart._write_err_dir8  re  rb   c                 2    SU4/nU R                  SU5        g )Nr  zc:errBarTyper  r  s      r`   r=  Chart._write_err_bar_type?       cl^
NJ7rb   c                 2    SU4/nU R                  SU5        g )Nr  zc:errValTyper  r  s      r`   r>  Chart._write_err_val_typeF  rG  rb   c                 .    S/nU R                  SU5        g )Nr=  z
c:noEndCapr  r  s     r`   r?  Chart._write_no_end_capM  r  rb   c                 2    SU4/nU R                  SU5        g )Nr  rT  r  r  s      r`   rA  Chart._write_error_valS  rB  rb   c                    US   (       ah  U R                  S5        [        US   [        5      (       a  U R                  US   5        OU R	                  US   US   S5        U R                  S5        US   (       ai  U R                  S5        [        US   [        5      (       a  U R                  US   5        OU R	                  US   US   S5        U R                  S5        g g )Nr  zc:plusr  rE  r  zc:minusr  )r  r8  r9  _write_num_litrP  r   r9  s     r`   r@  Chart._write_custom_errorZ  s     m$)*]3T::##J}$=>##}-z+/F h'n%	**^4d;;##J~$>?##~.
<0H% i( &rb   c                 6   [        U5      nU R                  S5        U R                  S5        U R                  U5        [	        U5       H)  nX   nUc  M   [        U5        U R                  X45        M+     U R                  S5        g ! [         a    Sn N5f = f)Nzc:numLitr  r   r  r  s        r`   rO  Chart._write_num_litu  s    D	 	J' 		* 	U#uAGE}e NN1$  	*%  s   B		BBc                 
   U R                   nUc  g U R                  S5        U R                  S5        U R                  UR	                  S5      5        U R                  UR	                  S5      5        U R                  S5        g )Nzc:upDownBars   r   r   )rJ   r  _write_gap_width_write_up_barsr   _write_down_barsr   )r^   rJ   s     r`   _write_up_down_barsChart._write_up_down_bars  sx    ((N+ 	c" 	L,,T23 	l..v67.)rb   c                 :    Uc  g SU4/nU R                  SU5        g )Nr  z
c:gapWidthr  r  s      r`   rU  Chart._write_gap_width  s'     ;cl^
L*5rb   c                     US   (       aA  US   S   (       a4  U R                  S5        U R                  U5        U R                  S5        g U R                  S5        g )Nrl   r  zc:upBarsr  r^   
bar_formats     r`   rV  Chart._write_up_bars  sR     f*V"4Y"?
+ j)j)
+rb   c                     US   (       aA  US   S   (       a4  U R                  S5        U R                  U5        U R                  S5        g U R                  S5        g )Nrl   r  z
c:downBarsr  r]  s     r`   rW  Chart._write_down_bars  sR     f*V"4Y"?- j)l+-rb   c                     U(       d  g SU4/nU R                  S5        U R                  SU5        U(       a3  U R                  S5        U R                  S5        U R                  S5        U R                  S5        g )Nr  zc:dispUnitszc:builtInUnitzc:dispUnitsLblr  r  )r^   unitsdisplayr  s       r`   r  Chart._write_disp_units  sq     en%
M*OZ8 01
+./-(rb   c                    SS/nUS   S:X  a  / nU R                  SU5        U R                  U5        US   S:X  a  U R                  US   5        O(U R                  US   5        U R	                  US   5        U R                  S5        g )N)flipr   )rotWithShaperK  r`  rg  z
a:gradFillangle)r  _write_a_gs_lst_write_a_lin_write_a_path_write_a_tile_rectr   )r^   ro   r  s      r`   rj  Chart._write_a_grad_fill  s     '(=>
Fx'JL*5 	X&Fx'hw/0 x/0 ##HV$45,'rb   c                    US   nUS   nU R                  S5        [        U5       HN  u  pE[        X$   S-  5      nSU4/nU R                  SU5        U R                  U5        U R	                  S5        MP     U R	                  S5        g )N	positionscolorsza:gsLstr   posza:gs)r  rc  r4  rx  r   )r^   ro   rp  rq  rg  r)  rr  r  s           r`   rj  Chart._write_a_gs_lst  s    [)	(#I&!&)HAilT)*C #,J
3e$f% * 	)$rb   c                 P    [        SU-  5      nSU4S/nU R                  SU5        g )Nr3  ang)scaled0za:linr  )r^   ri  r  s      r`   rk  Chart._write_a_lin  s7     EEM" EN


 	GZ0rb   c                 v    SU4/nU R                  SU5        U R                  U5        U R                  S5        g )Npathza:path)r  _write_a_fill_to_rectr   r^   gradient_typer  s      r`   rl  Chart._write_a_path  s?     }-.
Hj1 	""=1(#rb   c                 F    US:X  a  / SQnOSS/nU R                  SU5        g )Nshape))r   50000)r  r  )r  r  )r   r  )r   100000)r  r  za:fillToRectr  r|  s      r`   r{  Chart._write_a_fill_to_rect   s4     G#J  J
 	NJ7rb   c                 B    US:X  a  / nOSS/nU R                  SU5        g )Nr  )r  -100000)r   r  z
a:tileRectr  r|  s      r`   rm  Chart._write_a_tile_rect2  s2     G#J ! J
 	L*5rb   c                     SUS   4/nU R                  SU5        U R                  US   5        U R                  US   5        U R                  S5        g )Nprstrn   z
a:pattFillfg_colorbg_color)r  _write_a_fg_clr_write_a_bg_clrr   )r^   rn   r  s      r`   ri  Chart._write_a_patt_fill?  s^     wy123
L*5 	WZ01 	WZ01,'rb   c                 j    U R                  S5        U R                  U5        U R                  S5        g )Nza:fgClrr  rx  r   r^   r)  s     r`   r  Chart._write_a_fg_clrN  ,    I&% )$rb   c                 j    U R                  S5        U R                  U5        U R                  S5        g )Nza:bgClrr  r  s     r`   r  Chart._write_a_bg_clrT  r  rb   )ArX   r%   r$   r)   r&   r6   r0   rY   rB   rT   rS   rC   rH   r    r]   r,   r+   r<   rI   r-   r.   r!   rZ   rW   rV   r(   r   r1   r/   rU   r'   r   rD   rE   r"   rF   rG   r   r7   r:   r9   r8   rK   r#   r   rA   rO   rL   rN   rP   rM   rR   rQ   rJ   r*   r[   r;   r5   r2   r?   r=   r4   r3   r@   r>   r  )F)__name__
__module____qualname____firstlineno____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   rJ  r   r   r   rp  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   r0  r  r$  r%  r&  r/  r-  r.  rP  rN  rO  rX  rn  rm  r  r  r  r  rt  r  r  r  r  rv  r  ry  r  rz  r{  r|  r~  r  r  r  r  r  r  r  rw  rx  r  r  r  r  r  r  r  r  r  r  r   r  r	  r
  r  r  r  r  rH  rG  r   r*  r+  r,  r@  r:  rC  r>  r;  rQ  rR  r  r'  r_  r^  r   rk  rh  r7  rx  r|  r  r  r4  r  r  r  rq  r+  r  r  r  r  r  r  r  r  r  r  r  r  r  r  rY  rZ  r  ra  rd  r$  r   r)  r  r*  r  r  r   r  r  r  r  r  r  r  r  r  ru  r(  r}  rH  r  r)  r*  r+  r,  r,  r8  r<  r=  r>  r?  rA  r@  rO  rX  rU  rV  rW  r  rj  rj  rk  rl  r{  rm  ri  r  r  __static_attributes____classcell__)r_   s   @r`   r   r      s   IVQ#f!.F;;<!&"2
%
 3*05
n%
N%
N,BB>"" < DBH=~+Z4l	xt&P2h*X+ZC2(#%' N82
3+%Z
:F(P
*,*6 3#j&U &2&*131<!#F#& &".:/32d%Lg%Re%Nq&f'&5	91134.46	4;;855725 79:4&4&:77;;6&p7+5
9-.9(+@%$ @E%,"""$*4,*!!#>.8!;6-
$*&224$>#4J():% :49u 9$; ;04c 44c 436.)`;/3456746,*40"/"5(@(5
5",
,1#7%r0(d!&4,
$;59994&(54	>$"3&><<96
B"'H48861)6&<*(6,.)$(2%$
1
$8$6(%U %%U % %rb   r   )r   r>  warningsr   xlsxwriter.colorr   r   r   r   r  r	   utilityr
   r   r   r   r   	XMLwriterr   r  rb   r`   <module>r     s9     	  .   }D%I }D%rb   