
    li                        d dl Z d dlZd dlmZmZmZ d dlmZ d dlm	Z	m
Z
 ddlmZ ddlmZ ddlmZ dd	lmZmZmZmZmZ  G d
 dej.                        Zy)    N)AnyDictOptionalwarn)Color
ColorTypes   )	xmlwriter)
ChartTitle)Shape)_datetime_to_excel_datetime_supported_datetimequote_sheetnamexl_range_formulaxl_rowcol_to_cellc                       e Zd ZdZd fdZddeeeef      ddfdZ	deeef   ddfdZ
deeef   ddfdZdeeef   ddfd	Zdeeef   ddfd
Zddeeeef      ddfdZdeeef   ddfdZdeeef   ddfdZdeeef   ddfdZddeddfdZdeddfdZddZddZddeeeef      ddfdZddeeeef      ddfdZddeeeef      ddfdZddeeeef      ddfdZddeeeef      ddfdZdded    ddfdZddZd Zd Zd Z d  Z!defd!Z"d" Z#d# Z$d$ Z%d% Z&d& Z'd' Z(d( Z)d) Z*ddeeeef      fd*Z+d+ Z,d, Z-d-e.de/fd.Z0d/ Z1d0 Z2d1 Z3d2 Z4dd3Z5dd4Z6dd5Z7dd6Z8dd7Z9dd8Z:dd9Z;dd:Z<dd;Z=dd<Z>dd=Z?dd>Z@dd?ZAdd@ZBdAeCddfdBZDddCZEddDZFddEZGddFZHddGZIddHZJddIZKddJZLddKZMddLZNddMZOddNZPddOZQddPZRddQZSddRZTddSZUddTZVddUZWddVZXddWZYddXZZddYZ[ddZZ\dd[Z]dd\Z^dd]Z_dd^Z`ddd_Zadd`ZbdddaZcddbZdddcZeddddZfddeZgddfZhddgZiddhZjddiZkddjZlddkZmddlZndddmZodddnZpddoZqddpZrddqZsddrZtddsZuddtZvdduZwddvZxddwZyddxZzddye{dze/ddfd{Z|ddye{dze/ddfd|Z}	 ddye{dze/ddfd}Z~dye{ddfd~ZddZddZddZddZddZddZddZddZddZddZddZddZddZddZdddZddZddZddZde.ddfdZddZddZddZddAeCddfdZddZddAeCddfdZddAeCddfdZdeddfdZdeddfdZddZddZddZddZddZddZddZddZddZddZddZddZddZddZddZddZddZddZddZddZddZddZddZddZddZddZddZddZddZddZddZddZddZddZddZddZddZddZddÄZddĄZddńZddƄZddǄZddȄZddɄZddʄZdd˄Zdd̄Zdd̈́Zdd΄ZddτZddЄZddфZdd҄ZddӄZddԄZddՄZddքZddׄZdd؄ZddلZddڄZddۄZdd܄Zdd݄ZddބZdd߄ZddZddZdAeCddfdZdAeCddfdZ xZS )Chartz:
    A class for writing the Excel XLSX Chart file.


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

        Ni   r      Fblr
    gapTi  i   between)?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_allowedr   title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    N/var/www/html/eduruby.in/venv/lib/python3.12/site-packages/xlsxwriter/chart.pyr   zChart.__init__*   s    	 $!&!$!$  %  

&"   $ $  #\
"$!&(# %!"$$&	    optionsc                 @   |i }d|vrt        d       y| j                  rd|vrt        d       yt        | j                        dk(  rt        d       y| j	                  |j                  d            }| j	                  |j                  d            }| j                  |j                  d      |j                  d	            \  }}| j                  ||j                  d
            }| j                  ||j                  d            }| j                  ||j                  d            }t        j                  |      }	t        j                  |j                  d            }
t        j                  |j                  d            }t        j                  |j                  d            }|rd| _        |rd}d}
| j                  |j                  d            }| j                  |j                  d            }|j                  d      }| j!                  |j                  d            }| j!                  |j                  d            }||d}| j#                  |j                  d            }| j%                  |j                  d            }|j                  dd      }|j                  d      }|rt'        j(                  |      }|j                  d      }|j                  d      }|s|rd| _        |j                  d      |r|d   | _        n
|d   | _        |j                  d      r|r|d   | _        n
|d   | _        i d|d|d|d	|d |d!|d"|d#|	d|
d|d|d|d|d$|d%|d&|d|||||d'}| j                  j5                  |       y)(z
        Add a data series to a chart.

        Args:
            options:  A dictionary of chart series options.

        Returns:
            Nothing.

        Nvaluesz%Must specify 'values' in add_series()
categoriesz=Must specify 'categories' in add_series() for this chart type   zGThe maximum number of series that can be added to an Excel Chart is 255namename_formulacategories_datavalues_data	name_datar[   patterngradientmarker	trendlinesmoothy_error_barsx_error_bars)rp   ro   pointsdata_labelsinvert_if_negativeFinvert_if_negative_colorr9   r8   Tr   overlapname_idval_data_idcat_data_idlinelabelsinvert_if_neginverted_color)r8   rq   
error_barsrn   )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_valuerX   rI   rH   rK   rJ   append)r\   r`   rb   rc   re   rf   cat_idval_idrv   ry   r[   rj   rk   rl   rm   rn   ro   rp   r}   rq   rz   r{   r|   r9   r8   r#   s                             r^   
add_serieszChart.add_seriesp   s     ?G 7"89!!l'&APQt{{s"%  &&w{{8'<=**7;;|+DE
 "00KK^!<
l
 "":w{{;L/MN""67;;}+EF##L'++k2JK ))'2 ))'++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"r_   c                 J    | j                  | j                  |      }|| _        y)z
        Set the chart X axis options.

        Args:
            options:  A dictionary of axis options.

        Returns:
            Nothing.

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

        Args:
            options: A dictionary of axis options.

        Returns:
            Nothing.

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

        Args:
            options: A dictionary of axis options.

        Returns:
            Nothing.

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

        Args:
            options: A dictionary of axis options.

        Returns:
            Nothing.

        N)r   r8   r   s      r^   set_y2_axiszChart.set_y2_axis,  r   r_   c                    |i }| j                  |j                  d      |j                  d            \  }}| j                  ||j                  d            }|| j                  _        || j                  _        || j                  _        |j                  d      r0| j                  |j                  d            | j                  _        n/| j                  |j                  d            | j                  _        t        j                  |      | j                  _        t        j                  |j                  d            | j                  _        t        j                  |j                  d            | j                  _        | j!                  |j                  d	      d
      | j                  _        |j                  d      | j                  _        |j                  dd      | j                  _        y)z
        Set the chart title options.

        Args:
            options: A dictionary of chart title options.

        Returns:
            Nothing.

        Nre   rf   datafont	name_fontr[   rk   layoutToverlaynoneF)r   r   r   rP   re   formuladata_id_convert_font_argsr   r   r   ry   r   r[   r   rk   _get_layout_propertiesr   r   hidden)r\   r`   re   rf   r   s        r^   	set_titlezChart.set_title;  sy    ?G!00KK^!<
l ##L'++f2EF 

)

$

 ;;v"55gkk&6IJDJJO #55gkk+6NODJJO  44W=

  44W[[5HI

 $<<W[[=TU

 !77H8MtT

 %[[3

 $KK6

r_   c                 0    | j                  |      | _        y)z
        Set the chart legend options.

        Args:
            options: A dictionary of chart legend options.

        Returns:
            Nothing.
        N)_get_legend_propertiesr,   r\   r`   s     r^   
set_legendzChart.set_legendm  s     11':r_   c                 0    | j                  |      | _        y)z
        Set the chart plot area options.

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

        Returns:
            Nothing.
        N)_get_area_propertiesr5   r   s     r^   set_plotareazChart.set_plotareaz  s     11':r_   c                 0    | j                  |      | _        y)z
        Set the chart area options.

        Args:
            options: A dictionary of chart area options.

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

        Args:
            style_id: An int representing the chart style.

        Returns:
            Nothing.
        Nr   r
   0   )r'   )r\   r'   s     r^   	set_stylezChart.set_style  s(     Ha<8b=H r_   optionc                 L    |sydddd}||vrt        d| d       y|| _        y)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   r;   )r\   r   valid_optionss      r^   show_blanks_aszChart.show_blanks_as  sC      
 &4VHA>?!r_   c                     d| _         y)z
        Display ``#N/A`` on charts as blank/empty cells.

        Args:
            None.

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

        Args:
            None.

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

        Args:
            options: A dictionary of chart size options.

        Returns:
            Nothing.
        Nr?   r@   rA   r
   rB   rC   r   rD   )r   r?   r@   rA   rB   rC   rD   r   s     r^   set_sizezChart.set_size  s     ?G [[$**5
kk(DKK8{{9a0{{9a0J2J2r_   c                    |i }i }|j                  dd      |d<   |j                  dd      |d<   |j                  dd      |d<   |j                  dd      |d<   | j                  |j                  d            |d<   || _        y)	z
        Set properties for an axis data table.

        Args:
            options: A dictionary of axis table options.

        Returns:
            Nothing.

        N
horizontalr
   verticaloutline	show_keysr   r   )r   r   rE   )r\   r`   rE   s      r^   	set_tablezChart.set_table  s     ?G%kk,:l#KK
A6j";;y!4i$[[a8k//F0CDf
r_   c                 L   |i }d}d}d}d}|j                  d      r3t        j                  |d         }t        j                  |d   d         }|j                  d      r3t        j                  |d         }t        j                  |d   d         }||d||dd| _        y)z
        Set properties for the chart up-down bars.

        Args:
            options: A dictionary of options.

        Returns:
            Nothing.

        Nupr[   down)ry   r[   )r   r   )r   r   r   r   rN   )r\   r`   up_lineup_fill	down_line	down_fills         r^   set_up_down_barszChart.set_up_down_bars  s     ?G 		 ;;t00?G00v1FGG ;;v2276?CI2276?63JKI  
 "!	
r_   c                 D   |i }t        j                  |      }t        j                  |j                  d            }t        j                  |j                  d            }t        j
                  |j                  d            }|rd| _        |rd}d}||||d| _        y)z
        Set properties for the chart drop lines.

        Args:
            options: A dictionary of options.

        Returns:
            Nothing.

        Nr[   rj   rk   ry   r[   rj   rk   )r   r   r   r   r   r   r[   rL   r\   r`   ry   r[   rj   rk   s         r^   set_drop_lineszChart.set_drop_lines.  s     ?G))'2))'++f*=> //I0FG 11'++j2IJ DI GD  	
r_   c                 D   |i }t        j                  |      }t        j                  |j                  d            }t        j                  |j                  d            }t        j
                  |j                  d            }|rd| _        |rd}d}||||d| _        y)z
        Set properties for the chart high-low lines.

        Args:
            options: A dictionary of options.

        Returns:
            Nothing.

        Nr[   rj   rk   r   )r   r   r   r   r   r   r[   rM   r   s         r^   set_high_low_lineszChart.set_high_low_linesU  s     ?G))'2))'++f*=> //I0FG 11'++j2IJ DI GD  	
r_   chartc                     |y|| _         y)z
        Create a combination chart with a secondary chart.

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

        Returns:
            Nothing.

        N)rW   )r\   r   s     r^   combinezChart.combine|  s     =r_   c                 t   | j                          | j                          | j                          | j                          | j	                          | j                          | j                  | j                         | j                  r| j                          | j                  d       | j                          y )Nc:chartSpace)_xml_declaration_write_chart_space_write_lang_write_style_write_protection_write_chart_write_sp_prr4   r$   _write_print_settings_xml_end_tag
_xml_closer   s    r^   _assemble_xml_filezChart._assemble_xml_file  s     	 	! 	 	 	  	 	$..) ==&&( 	.)r_   c                 \   |d   j                         }|j                  |       i d|d   d|j                  d      d|j                  d      d|j                  d      d|j                  d      d|j                  d      d|j                  d      d|j                  d      d	|j                  d	      d
|j                  d
      d|j                  d      d|j                  d      d|j                  d      d|j                  d      d|j                  d      d|j                  d      d|j                  d      |j                  d      |j                  d      dt               d}|j                  dd      |d<   | j	                  |d	         |d	<   |j                  dd      |d<   |j                  d      r|d   d   r| j                  |d         |d<   |j                  d      r|d   d   r| j                  |d         |d<   |j                  d      r|d   j                         d   |d<   |j                  d      r|d   dk(  rd|d<   n|d   dk(  rnd |d<   |j                  d      rd| _        |j                  d       rd| _        d|d <   |j                  d      r5t        |d         r't        |d   | j                  | j                        |d<   |j                  d      r5t        |d         r't        |d   | j                  | j                        |d<   |j                  d      r5t        |d         r't        |d   | j                  | j                        |d<   | j                  |j                  d!            |d!<   t        j                  |      |d"<   t        j                  |j                  d#            |d#<   t        j                   |j                  d$            |d$<   t        j"                  |j                  d%            |d%<   |j                  d$      rd |d#<   |j                  d%      r
d |d$<   d |d#<   | j%                  |j                  d&            |d&<   | j%                  |j                  d'            |d'<   | j'                  |j                  d(      |j                  d)            \  }}| j)                  ||j                  d*            }||d+   _        ||d+   _        ||d+   _        | j                  |j                  d,            |d+   _        | j3                  |j                  d-      d      |d+   _        |j                  d.      |d"<   |j                  d/      |d0<   t        j                  |      |d+   _        t        j                  |j                  d1            |d+   _        t        j                   |j                  d2            |d+   _        t        j"                  |j                  d3            |d+   _        |S )4Ndefaults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   	text_axisrP   visibleTdisplay_units_visiblemajor_gridlinesminor_gridlinesr   on_tickmidCatr   	date_axisr   num_fontry   r[   rj   rk   minor_tick_markmajor_tick_markre   rf   r   rP   r   name_layout	name_linename_borderborder	name_fillname_patternname_gradient)copyupdater   r   _get_display_units_get_gridline_propertieslowerrQ   r   r   rR   rS   r   r   r   r   r   r   _get_tick_typer   r   re   r   r   r   r   r   ry   r[   rj   rk   )r\   r   user_optionsr`   re   rf   r   s          r^   r   zChart._convert_axis_args  s9   z"'')|$
Z(
w{{9-
 7;;u%
 7;;u%	

 '++l3
 '++l3
 w{{+<=
 w{{+<=
 W[[9
 J/
 J/
 W[[9
 J/
 gkk*:;
 7;;}5
  '++l3!
"  -@!A#
$ %[[9$[[9\+
0 "++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:Z $..$2F2F D
  227;;z3JKZ 11':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 "00KK^!<
l
 ##L'++f2EF "W ,W 'W!44W[[5MNW#::KK& 
W
 "++k2#KK6"77@W"77K8PQW % = =KK'!
W "'!?!?KK("
W r_   c                    |si S |j                  d      |j                  d      |j                  d      |j                  d      |j                  d      |j                  d      |j                  d      |j                  d      |j                  d	d
      |j                  d      d
}|d   rt        |d   dz        |d<   |d   rdt        |d         z  |d<   |j                  d      rt        j                  |d         |d<   |S )Nre   colorsizebolditalic	underlinepitch_familycharsetbaseliner   rotation)
re   r  r  r  r  r  r  r  r  r  d   `  )r   intr   r   )r\   r`   r   s      r^   r   zChart._convert_font_argsD  s    I KK'[[)KK'KK'kk(+ [1#KK7{{9-J2J/
 <tF|c12DL 
$s4
+;'<<D88G!--d7m<DMr_   c                     t        |t              s'|r#d|v rd|vr| j                  rt        d| d       |S t	        | }|S )N r   zSheetname in 'zE' contains spaces but isn't quoted. This may cause an error in Excel.)
isinstancelistrY   r   r   )r\   r   r   s      r^   r   zChart._list_to_formulac  sT     $%t4D<O<O$TF +8 9 K"D)r_   c                     |Xt        |t              r.t        |d   |d   dd      }t        |d         dz   |z   }d}||fS t	        j
                  d|      r|}d}||fS )Nr
   r   Tr   !r   ^=?[^!]+!\$?[A-Z]+\$?\d+)r%  r&  r   r   rematch)r\   re   rf   cells       r^   r   zChart._process_namest  s|     $%(a$q'4F.tAw7#=D \!! 5t<#\!!r_   c                     |t        |      dk(  ryt        |d   t              ry|D ]9  }|t        |t              rt	        j
                  d|      r y	 t        |       ; y# t        $ r Y  yw xY w)Nr   r   	multi_strz[_ ]strnum)r~   r%  r&  r/  r*  searchfloat
ValueError)r\   r   tokens      r^   _get_data_typezChart._get_data_type  s     <3t9>d1gt$  	E} %%"))FE*Be	"   s   A%%	A21A2c                 H   |sy |j                  d      r|j                  d      }|| j                  vrAt        | j                        }| j                  j                  |       || j                  |<   |S | j                  |   }| j                  |   || j                  |<   |S )N=)
startswithlstripr/   r~   r0   r   )r\   r   r   
formula_ids       r^   r   zChart._get_data_id  s      c"nnS)G $***T../J$$T*(2DW%  ))'2J   ,404!!*-r_   c                    |sy t        j                  |      }dddddddddd	d	d
ddd}|j                  d      }|||v r	||   |d<   nt        d|        y t	        j
                  |      }t	        j                  |j                  d            }t	        j                  |j                  d            }t	        j                  |j                  d            }|rd | _	        |rd }d }||d<   ||d<   ||d<   ||d<   |S )N	automaticr   squarediamondtrianglexstardotdashcirclepluspicture)r<  r   r=  r>  r?  r@  rA  rB  
short_dashrC  	long_dashrD  rE  rF  typezUnknown marker type 'r[   rj   rk   ry   )
r  deepcopyr   r   r   r   r   r   r   r[   )r\   rl   typesmarker_typery   r[   rj   rk   s           r^   r   zChart._get_marker_properties  s5     v& % " 
$ jj("e#!&{!3v,[M:; ))&1 ))&**V*<= //

90EF 11&**Z2HI DI GDvv#y%zr_   c                 6   |sy t        j                  |      }ddddddd}|j                  d      }||v r	||   |d<   nt        d	| d
       y t	        j
                  |      }t	        j                  |j                  d            }t	        j                  |j                  d            }t	        j                  |j                  d            }| j                  |j                  d            }|rd | _
        |rd }d }||d<   ||d<   ||d<   ||d<   ||d<   |S )Nexplinearlog	movingAvgpolypower)exponentialrO  rP  moving_average
polynomialrS  rI  zUnknown trendline type 'r   r[   rj   rk   labelry   )r  rJ  r   r   r   r   r   r   r   _get_trendline_label_propertiesr[   )	r\   rm   rK  
trend_typery   r[   rj   rk   rW  s	            r^   r   zChart._get_trendline_properties  sB     MM),	 !) 
 ]]6*
 %j 1If+J<q9: )))4 )))--*?@ //	i0HI 11)--
2KL 44Y]]75KL DI GD 	& 	&&	) (	*"	'r_   c                    |si S t        j                  |      }| j                  |j                  d            }t	        j
                  |      }t	        j                  |j                  d            }t	        j                  |j                  d            }t	        j                  |j                  d            }|rd | _	        |rd }d }||d<   ||d<   ||d<   ||d<   ||d<   |S )Nr   r[   rj   rk   ry   )
r  rJ  r   r   r   r   r   r   r   r[   )r\   rW  r   ry   r[   rj   rk   s          r^   rX  z%Chart._get_trendline_label_properties?  s     I e$ &&uyy'89 ))%0 ))%))F*;< //		)0DE 11%))J2GH DI GDfff"i$jr_   c                    |si S ddddd}dddddd	}|d
   }||v r	||   |d
<   nt        d|        i S d|v r|d   |d<   d|v r|d   |d<   d|v r|d   dk(  rd|d<   n|d   dk(  rd|d<   n	 |j                  d      |d<   |j                  d      |d<   |j                  d      |d<   |j                  d      |d<   t        j                  |      |d<   |S )NfixedValr
   both)rI  valueendcap	direction
percentagestdDevstdErrcust)fixedra  standard_deviationstandard_errorcustomrI  zUnknown error bars type 'r^  	end_styler_  r`  minusrE  plus_valuesminus_values	plus_data
minus_datary   )r   r   r   r   )r\   r`   r}   rK  
error_types        r^   r   zChart._get_error_bars_propsh  sD   I )1PVW
  &"*&
 V_
!&z!2Jv,ZL9:I g")'"2Jw '!#*;#7Jx  '!{#w.*1
;'%/*0
;'  %,KK$>
=!%,[[%@
>"")++k":
;#*;;|#<
<  #77@
6r_   c                 \    d|j                  d      i}t        j                  |      |d<   |S )Nr   ry   )r   r   r   )r\   r`   gridlines      r^   r  zChart._get_gridline_properties  s3     w{{956 !55g>r_   c                    |sy t        j                  |      }|j                  d      }|rF|| j                  v r(|| j                  k(  rd |d<   n#| j                  |   |d<   nt        d| d       y |j                  d      }ddddd	d
}|r||v r	||   |d<   nt        d       y | j                  |j                  d            |d<   t        j                  |      }t        j                  |j                  d            }t        j                  |j                  d            }t        j                  |j                  d            }|rd | _        |rd }d }||d<   ||d<   ||d<   ||d<   |j                  d      r|d   D ]  }	|	|	j                  d      }
|
r$t        j                  dt        |
            r|
|	d<   |	j                  d      }|r%|j!                  d      r|j#                  d      |	d<   | j%                  ||	j                  d            }||	d<   | j                  |	j                  d            |	d<   t        j                  |	      }t        j                  |	j                  d            }t        j                  |	j                  d            }t        j                  |	j                  d            }|rd | _        |rd }d }|	j                  d      }|rG|| j                  v r(|| j                  k(  rd |	d<   n$| j                  |   |	d<   nt        d| d        y ||	d<   ||	d<   ||	d<   ||	d<    |S )Nr   zUnsupported label position 'z' for this chart type	separatorz, z; z. 
r$  ),;.rt  r$  zUnsupported label separatorr   r[   rj   rk   ry   rh  r^  r)  r   r7  r   r   z' for chart type)r  rJ  r   rT   rU   r   r   r   r   r   r   r   r[   r*  r+  r/  r8  r9  r   )r\   rz   r   rs  
separatorsry   r[   rj   rk   rW  r^  r   r   s                r^   r   zChart._get_labels_properties  sh     v& ::j)4///t:::)-F:&)-)=)=h)GF:&3H:=RST JJ{+	

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

90EF 11&**Z2HI DI GDvv#y%z::h) 6-=		'*RXX&A3u:N',E)$))I.w11#6'.~~c':E)$++GUYYv5FG#*i  $ 7 7		&8I Jf 11%8 11%))F2CD  77		)8LM !99%))J:OP  $DI "GD !99Z04#7#77#t'B'BB04E*-040D0DX0NE*-;H:EUVW# $f $f#*i $,j!m6-p r_   c                    i }t        j                  |      }t        j                  |j                  d            }t        j                  |j                  d            }t        j
                  |j                  d            }|rd | _        |rd }d }| j                  |j                  d      d      }||d<   ||d<   ||d<   ||d<   ||d<   |S )Nr[   rj   rk   r   Fry   )r   r   r   r   r   r   r[   r   )r\   r`   areary   r[   rj   rk   r   s           r^   r   zChart._get_area_properties(  s     ))'2 ))'++f*=> //I0FG 11'++j2IJ DI GD ,,W[[-BEJVV!YX#Zr_   c                    i }|i }|j                  dd      |d<   |j                  d      |d<   | j                  |j                  d            |d<   | j                  |j                  d      d      |d<   |j                  d      rd|d<   t        j                  |      }t        j
                  |j                  d            }t        j                  |j                  d	            }t        j                  |j                  d
            }|rd | _        |rd }d }| j                  |j                  d      d      }||d<   ||d<   ||d	<   ||d<   ||d
<   |S )Nr   rightdelete_seriesr   r   Fr   r[   rj   rk   ry   )	r   r   r   r   r   r   r   r   r[   )r\   r`   r,   ry   r[   rj   rk   r   s           r^   r   zChart._get_legend_propertiesL  s^   ?G$[[W=z")++o">00V1DEv66w{{87LeTx ;;v!'F: ))'2 ))'++f*=> //I0FG 11'++j2IJ DI GD ,,W[[-BEJvv#y!x%zr_   c           	         i }|si S |rd}nd}|j                         D ]  }||vst        d| d       i c S  |D ]_  }||j                         vrt        d| d       i c S ||   }	 t        |       |dk  s|d	kD  rt        d| d| d
       i c S |d||<   a |S # t        $ r t        d| d| d       i cY c S w xY w)N)r@  y)r@  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   r2  r3  )r\   argsis_textr   
propertieskeypropr^  s           r^   r   zChart._get_layout_properties|  s   I#J6J 99; 	C*$z#&GHI		  	+D499;&z$'LMN	JEe
 qyEAI iw 73 4 	 $D\F4L+	+.   z$y7RST	s   *B  CCc                    g }|sg S |D ]  }i }|t        j                  |      }t        j                  |j                  d            }t        j                  |j                  d            }t        j
                  |j                  d            }|rd | _        |rd }d }||d<   ||d<   ||d<   ||d<   |j                  |        |S )Nr[   rj   rk   ry   )r   r   r   r   r   r   r[   r   )	r\   user_pointsrq   
user_pointpointry   r[   rj   rk   s	            r^   r   zChart._get_points_properties  s    I% 	!JE%11*= 11*..2HI  77
y8QR !99*..:TU  $DI "GD $f $f#*i $,j!MM% =	!@ r_   elementc                     |j                  d      xr |d   d   }|j                  d      xr |d   d   }|j                  d      }|j                  d      }|xs
 |xs |xs |S )Nr[   definedry   rj   rk   )r   )r\   r  has_fillhas_linehas_patternhas_gradients         r^   _has_formattingzChart._has_formatting  sk    ;;v&E76?9+E;;v&E76?9+Ekk),{{:.B8B{BlBr_   c           
      V    |sy ddddddddd	d
	}||v r||   }|S t        d| d       y )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   rK  s      r^   r  zChart._get_display_units  s_     #$+!3") 1"$

 E!!-0M
  /a@Ar_   c                 L    |sy ddddd}||v r||   }|S t        d| d       y )Noutinr   cross)outsideinsider   r  zUnknown tick_type 'r   r   )r\   	tick_typerK  s      r^   r  zChart._get_tick_type  sP     	
 i(I
  &yk34r_   c                 Z    g }| j                   D ]  }|d   r	|j                  |        |S Nr8   r#   r   )r\   primary_axes_seriesr#   s      r^   _get_primary_axes_serieszChart._get_primary_axes_series  s9     kk 	3F)$#**62	3 #"r_   c                 Z    g }| j                   D ]  }|d   s	|j                  |        |S r  r  )r\   secondary_axes_seriesr#   s      r^   _get_secondary_axes_seriesz Chart._get_secondary_axes_series  s9     "kk 	5Fi %,,V4	5 %$r_   c                    dt        | j                        z   }dt        | j                        z   t        | j                        z   }|d|d}|d|dz   d}|d   r6| j                  j                  |       | j                  j                  |       |d   s7| j                  j                  |       | j                  j                  |       y y )Ni  r
   04dprimary_axes)r"  r%   r~   r)   r(   r   )r\   r  chart_id
axis_countid1id2s         r^   _add_axis_idszChart._add_axis_ids  s    #dgg,&T^^,,s4==/AA
#z#./#zA~c23MM  %MM  %N#NN!!#&NN!!#& $r_   c                 0   dddid| j                   d<   dddid| j                  d<   ddddd	| j                  d<   dddid
dd| j                  d<   | j	                  i        | j                  i        | j                  i        | j                  i        y )NGeneralr   r   )r   r   r   r
   r   r   )r   r   r   r   r|  )r   r   r   r   )r6   r7   r9   r8   r   r   r   r   r   s    r^   rZ   zChart._set_default_properties+  s     $ )1~#
J $ )1~#
J $$	$
Z  $ )1~	$
Z  	r_   c                 `    d}|dz   }|dz   }|dz   }d|fd|fd|fg}| j                  d|       y )	Nz"http://schemas.openxmlformats.org/zdrawingml/2006/chartzdrawingml/2006/mainz!officeDocument/2006/relationshipszxmlns:czxmlns:azxmlns:rr   )_xml_start_tag)r\   schemaxmlns_cxmlns_axmlns_r
attributess         r^   r   zChart._write_chart_spaceR  s[    51100>>    

 	NJ7r_   c                 6    d}d|fg}| j                  d|       y )Nen-USvalzc:lang_xml_empty_tagr\   r  r  s      r^   r   zChart._write_langa  s"    cl^
Hj1r_   c                 V    | j                   }|dk(  ry d|fg}| j                  d|       y )Nr   r  zc:style)r'   r  )r\   r'   r  s      r^   r   zChart._write_stylei  s4    == q=h'(
Iz2r_   c                    | j                  d       | j                  j                         r| j                          n| j	                  | j                         | j                          | j                          | j                          | j                          | j                  r| j                          | j                  d       y )Nzc:chart)r  rP   	is_hidden_write_c_auto_title_deleted_write_title_write_plot_area_write_legend_write_plot_vis_only_write_disp_blanks_asr<   _write_c_ext_lst_display_nar   r   s    r^   r   zChart._write_chartu  s    I&::!,,. djj) 	 	 	!!# 	""$   ,,.)$r_   c                 V    | j                   }|dk(  ry d|fg}| j                  d|       y )Nr   r  zc:dispBlanksAs)r;   r  r  s      r^   r  zChart._write_disp_blanks_as  s5     %<cl^
,j9r_   c                 f   | j                  d       | j                  | j                  j                  d      d       | j	                  ddi       | j	                  ddi       | j
                  }|rz|j                  rd| j                  z   |_        n| j                  |_        | j                  |_        | j                  |_	        |j	                  ddi       |j	                  ddi       | j                  | j                  | j                  d}| j                  r| j                  |       n| j                  |       | j!                  |       | j"                  | j$                  | j&                  d}| j!                  |       |rA|j                  r5|j"                  |j$                  |j&                  d}|j!                  |       | j                  r| j                  |       n| j                  |       | j)                          | j+                  | j                         | j-                  d       y )	Nz
c:plotArear   plotr  TF  )r6   r7   r(   )r  _write_layoutr5   r   _write_chart_typerW   rX   r%   fhr&   r6   r7   r(   rQ   _write_date_axis_write_cat_axis_write_val_axisr9   r8   r)   _write_d_tabler   r   )r\   second_chartr  s      r^   r  z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 ((.!!$'  & 	 	$--(,'r_   c                     |s| j                  d       y | j                  d       | j                  ||       | j                  d       y )Nc:layout)r  r  _write_manual_layoutr   r\   r   layout_types      r^   r  zChart._write_layout  sC     
+ 
+%%fk:j)r_   c                    | j                  d       |dk(  r| j                  ddg       | j                  ddg       | j                  ddg       | j                  dd	|d
   fg       | j                  dd	|d   fg       |dk7  r0| j                  dd	|d   fg       | j                  dd	|d   fg       | j                  d       y )Nzc:manualLayoutr  zc:layoutTarget)r  innerzc:xMode)r  edgezc:yModezc:xr  r@  zc:yr  textzc:wr?   zc:hr@   r  r  r   r  s      r^   r  z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*+r_   c                      y N r\   r  s     r^   r  zChart._write_chart_type  s     	r_   c                 2    d|fg}| j                  d|       y )Nr  z
c:groupingr  r  s      r^   _write_groupingzChart._write_grouping  s    cl^
L*5r_   c                 &    | j                  |       y r  )
_write_serr\   r#   s     r^   _write_serieszChart._write_series  s    r_   c                    | j                   }| xj                   dz  c_         | j                  d       | j                  |       | j                  |       | j	                  |       | j                  |       | j                  |d          | j                  |d          | j                  |d          | j                  |d          | j                  |d          | j                  |d          | j                  |       | j                  |       | j                  r| j                  |d	          |j!                  d
      r| j#                  |d
          | j%                  d       y )Nr
   zc:serrl   r{   rq   rz   rm   r}   rn   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_valrO   _write_c_smoothr   _write_c_ext_lst_inverted_colorr   )r\   r#   indexs      r^   r  zChart._write_ser  sS   !!QG$ 	 	%  	' 	&! 	6(+, 	(()@A 	)* 	6(+, 	f[12 	vl34 	 	   !12 ::&'008H1IJ'"r_   r  c                 `   d}d}d|fd|fg}d|fg}| j                  d       | j                  d|       | j                  d       | j                  d|       | j                  d	|i       | j                  d       | j                  d       | j                  d       | j                  d       y )
Nz&{6F2FDCE9-48DA-4B69-8628-5D25D57E5C99}z:http://schemas.microsoft.com/office/drawing/2007/8/2/charturiz	xmlns:c14c:extLstc:extzc14:invertSolidFillFmtzc14:spPrr  )r  _write_a_solid_fillr   )r\   r  r   
xmlns_c_14attributes1attributes2s         r^   r  z%Chart._write_c_ext_lst_inverted_colorL  s     7Q
 CL*%

 $Z01J'G[145J4  '5!12*%23'"*%r_   c                    d}d}d|fd|fg}dg}| j                  d       | j                  d|       | j                  d       | j                  d	|       | j                  d       | j                  d       | j                  d       y )
Nz&{56B9EC1D-385E-4148-901F-78D8002777C0}z9http://schemas.microsoft.com/office/drawing/2017/03/chartr   zxmlns:c16r3r  r
   r  r  zc16r3:dataDisplayOptions16zc16r3:dispNaAsBlankr  )r\   r   
xmlns_c_16r  r  s        r^   r  z!Chart._write_c_ext_lst_display_nae  s     7P
 CLJ'

 "lJ'G[1891;?67'"*%r_   c                 2    d|fg}| j                  d|       y )Nr  zc:idxr  r  s      r^   r  zChart._write_idxz       cl^
GZ0r_   c                 2    d|fg}| j                  d|       y )Nr  c:orderr  r  s      r^   r  zChart._write_order  s     cl^
Iz2r_   c                 t    |d   | j                  |d   |d          y |d   | j                  |d          y y )Nrf   rv   re   )_write_tx_formula_write_tx_valuer  s     r^   r  zChart._write_series_name  sJ     .!-""6.#96);LMF^'  0 (r_   c                 0    |r| j                  ddg       y y )Nzc:smooth)r  1r  )r\   rn   s     r^   r  zChart._write_c_smooth  s     
\N; r_   c                 \   |d   }|d   }d }|| j                   |   }|sy | j                  d       | j                  |      }|dk(  rd| _        | j	                  |||       n9|dk(  rd| _        | j                  ||       nd| _        | j                  |||       | j                  d       y )Nrc   rx   zc:catr/  Fr.  T)r0   r  r5  r*   _write_str_ref_write_multi_lvl_str_ref_write_num_refr   )r\   r#   r   r   r   cat_types         r^   r  zChart._write_cat  s    &'$$W-D G$ &&t,u#(D x8$#(D ))'48 $(D x8'"r_   c                     |d   }|d   }| j                   |   }| j                  d       | j                  ||d       | j                  d       y )Nrb   rw   c:valr0  )r0   r  r  r   )r\   r#   r   r   r   s        r^   r  zChart._write_val  sV    "'  )G$ 	GT51'"r_   c                     | j                  d       | j                  |       |dk(  r| j                  |       n|dk(  r| j                  |       | j	                  d       y )Nzc:numRefr0  r/  r  _write_series_formula_write_num_cache_write_str_cacher   r\   r   r   ref_types       r^   r  zChart._write_num_ref  sZ    J' 	""7+u!!$'!!$'*%r_   c                     | j                  d       | j                  |       |dk(  r| j                  |       n|dk(  r| j                  |       | j	                  d       y )Nzc:strRefr0  r/  r  r  s       r^   r  zChart._write_str_ref  s\     	J' 	""7+u!!$'!!$'*%r_   c                    |sy | j                  d       | j                  |       | j                  d       t        |d         }| j                  |       t	        |      D ]I  }| j                  d       t        |      D ]  \  }}| j                  ||        | j                  d       K | j                  d       | j                  d       y )Nzc:multiLvlStrRefzc:multiLvlStrCacher   zc:lvl)r  r  r~   _write_pt_countreversed	enumerate	_write_ptr   )r\   r   r   countcat_datair  s          r^   r  zChart._write_multi_lvl_str_ref  s     ./ 	""7+01 DHU#  	'H(%h/ )5q%() g&	' 	./,-r_   c                 l    |j                  d      r|j                  d      }| j                  d|       y )Nr7  zc:f)r8  r9  _xml_data_element)r\   r   s     r^   r  zChart._write_series_formula  s0     c"nnS)Gug.r_   c                 "   | j                  |       |d   r=| j                  | j                  d          | j                  | j                  d          y | j                  | j                  d          | j                  | j                  d          y )Nr  r   r
   )r  _write_axis_idr(   r)   r  s     r^   _write_axis_idszChart._write_axis_ids  sx     	4 a 01a 01 q 12q 12r_   c                 2    d|fg}| j                  d|       y )Nr  zc:axIdr  r  s      r^   r-  zChart._write_axis_id       cl^
Hj1r_   c                    |d   }|d   }|d   }||sy | j                   }| j                  }|j                  d      r|d   }| j                  d       | j	                  |d          | j                  |j                  d      d d d        |j                  d      s| j                  d	       | j                  ||j                  d             | j                  |j                  d
             | j                  |j                  d             | j                  |d   |       | j                  |       | j                  |j                  d             | j                  |j                  d             | j                  |j                  d             | j                  |       | j!                  |j                  d             | j#                  |d	          | j$                  s|j                  d      rn|j                  d      |j                  d      dk(  s|d   dk(  r!| j'                  |j                  d             n | j)                  |j                  d             |j                  d      s| j+                  d	       | j-                  |j                  d             | j/                  d       | j1                  |j                  d             | j3                  |j                  d             | j5                  d       y )Nr6   r7   r(   r   zc:catAxr   r   r   r
   r   r  rP   r  r  r   r  r   r   r   r   r   r   r   r   )r-   r1   r   r  r-  _write_scaling_write_delete_write_axis_pos_write_major_gridlines_write_minor_gridlinesr  _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  r6   r7   r(   r   is_horizontals          r^   r  zChart._write_cat_axis$  s   hh
# 8))++ ::j!j)HI&HQK( 	FJJy14tDzz)$q! 	Xvzz)'<= 	##FJJ/@$AB 	##FJJ/@$AB 	&/=9 	%%f- 	##FJJ/@$AB 	##FJJ/@$AB 	""6::.>#?@ 	&! 	fjj45 	x{+

9 5 

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

= 9: 	  % 	##FJJ$?@ 	$$VZZ%@A)$r_   c                 2   |d   }|d   }|d   }|j                  d| j                        }| j                  }||sy |j                  d      xs |}| j                  d       | j	                  |d          | j                  |j                  d      |j                  d      |j                  d	      |j                  d
             |j                  d      s| j                  d       | j                  ||j                  d             | j                  |j                  d             | j                  |j                  d             | j                  |d   |       | j                  |       | j                  |j                  d             | j                  |j                  d             | j                  |j                  d             | j                  |       | j!                  |j                  d             | j#                  |d          |j                  d      |d   d	k(  s|d   dk(  r!| j%                  |j                  d             n | j'                  |j                  d             | j)                  |j                  d             | j+                  |j                  d             | j-                  |j                  d             | j/                  |j                  d      |j                  d             | j1                  d       y )Nr6   r7   r(   r   c:valAxr
   r   r   r   r   r   r   r  rP   r  r  r   r  r   r   r   r   r   r   r   )r   r.   r2   r  r-  r2  r3  r4  r5  r6  r  _write_number_formatr8  r9  r:  r   r;  r<  r=  r>  _write_cross_between_write_c_major_unit_write_c_minor_unit_write_disp_unitsr   rD  s          r^   r  zChart._write_val_axis  s   hh
#88J(>(>?++ 8 ::j)5XI&HQK( 	JJy!JJuJJuJJz"		
 zz)$q! 	Xvzz)'<= 	##FJJ/@$AB 	##FJJ/@$AB 	&/=9 	!!&) 	##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	
 	)$r_   c                     |d   }|d   }|d   }|d   xs | j                   }| j                  }||sy |j                  d      xs |}| j                  d       | j	                  |d          | j                  |j                  d      |j                  d      |j                  d	      |j                  d
             |j                  d      s| j                  d       | j                  ||j                  d             | j                  |j                  d             | j                  |j                  d             | j                  |d   |       | j                  |       | j                  |j                  d             | j                  |j                  d             | j                  |j                  d             | j                  |       | j!                  |j                  d             | j#                  |d          |j                  d      |d   d	k(  s|d   dk(  r!| j%                  |j                  d             n | j'                  |j                  d             | j)                  |j                  d             | j+                  |j                  d             | j-                  |j                  d             | j/                  |j                  d      |j                  d             | j1                  d       y )Nr6   r7   r(   r   rG  r   r   r   r   r   r   r
   r   r  rP   r  r  r   r  r   r   r   r   r   r   )r.   r2   r   r  r-  r2  r3  r4  r5  r6  r  rH  r8  r9  r:  r   r;  r<  r=  r>  rI  rJ  rK  rL  r   rD  s          r^   _write_cat_val_axiszChart._write_cat_val_axis  s    hh
#
#=t'='=++ 8 ::j)5XI&HQK( 	JJy!JJuJJuJJz"		
 zz)$q! 	Xvzz)'<= 	##FJJ/@$AB 	##FJJ/@$AB 	&/=9 	!!&) 	##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	
 	)$r_   c                    |d   }|d   }|d   }||sy | j                   }|j                  d      xs |}| j                  d       | j                  |d          | j	                  |j                  d      |j                  d      |j                  d	      |j                  d
             |j                  d      s| j                  d       | j                  ||j                  d             | j                  |j                  d             | j                  |j                  d             | j                  |d          | j                  |       | j                  |j                  d             | j                  |j                  d             | j                  |j                  d             | j                  |       | j                  |j                  d             | j!                  |d          | j"                  s|j                  d      rn|j                  d      |j                  d      d	k(  s|d   dk(  r!| j%                  |j                  d             n | j'                  |j                  d             | j)                  d       | j+                  d       | j-                  |j                  d             | j/                  |j                  d             | j1                  |j                  d             |j                  d      r| j3                  |d          | j5                  |j                  d             |j                  d      r| j7                  |d          | j9                  d       y )Nr6   r7   r(   r   zc:dateAxr   r   r   r   r   r   r
   r   r  rP   r  r  r   r  r   r   r   r   r   r   r   r   )r-   r   r  r-  r2  r3  r4  r5  r6  r  rH  r8  r9  r:  r   r;  r<  r>   r=  r>  r?  rA  rB  rC  rJ  _write_c_major_time_unitrK  _write_c_minor_time_unitr   )r\   r  r6   r7   r(   r   s         r^   r  zChart._write_date_axis6	  s   hh
# 8)) ::j)5XJ'HQK( 	JJy!JJuJJuJJz"		
 zz)$q! 	Xvzz)'<= 	##FJJ/@$AB 	##FJJ/@$AB 	&/* 	!!&) 	##FJJ/@$AB 	##FJJ/@$AB 	""6::.>#?@ 	&! 	fjj45 	x{+

9 5 

:&.::j)U2*%. ##FJJz$:; ((J)?@ 	 	  % 	##FJJ$?@ 	$$VZZ%@A 	  L!9: ::l#))&1B*CD 	  L!9: ::l#))&1B*CD*%r_   c                     | j                  d       | j                  |       | j                  |       | j                  |       | j	                  |       | j                  d       y )Nz	c:scaling)r  _write_c_log_base_write_orientation_write_c_max_write_c_minr   )r\   r   min_valmax_valr   s        r^   r2  zChart._write_scaling	  s`     	K( 	x( 	( 	'" 	'"+&r_   c                 8    |sy d|fg}| j                  d|       y )Nr  z	c:logBaser  r  s      r^   rS  zChart._write_c_log_base	  %     cl^
K4r_   c                 >    d}|rd}d|fg}| j                  d|       y )NminMaxmaxMinr  zc:orientationr  )r\   r   r  r  s       r^   rT  zChart._write_orientation	  s*    Ccl^
OZ8r_   c                 8    |y d|fg}| j                  d|       y )Nr  zc:maxr  )r\   rX  r  s      r^   rU  zChart._write_c_max	  )     ?g&'
GZ0r_   c                 8    |y d|fg}| j                  d|       y )Nr  zc:minr  )r\   rW  r  s      r^   rV  zChart._write_c_min	  r_  r_   c                 R    |r|dk(  rd}|dk(  rd}d|fg}| j                  d|       y )Nr   rr   tr  zc:axPosr  )r\   r  r   r  s       r^   r4  zChart._write_axis_pos	  s:     czczcl^
Iz2r_   c                     |j                  d      }d}|||d   d   k7  rd}|j                  d      rd}d|fd|fg}| j                  d|       y 	Nr   r
   r   r   r   
formatCodesourceLinkedc:numFmt)r   r  )r\   r   format_codesource_linkedr  s        r^   rH  zChart._write_number_format	  st    
 hh|, "{d:6F|6T'TM 88'(M ;']+


 	J
3r_   c                     |j                  d      }d}d}|||d   d   k7  rd}d}|j                  d      rd}| j                  s|ry d|fd|fg}| j                  d|       y re  )r   r*   r  )r\   r   ri  rj  default_formatr  s         r^   r7  zChart._write_cat_number_format	  s     hh|, "{d:6F|6T'TMN 88'(M ## ;']+


 	J
3r_   c                 <    d}d|fd|fg}| j                  d|       y )Nr   rf  rg  rh  r  )r\   ri  rj  r  s       r^   _write_data_label_number_formatz%Chart._write_data_label_number_format
  s2     ;']+


 	J
3r_   c                 8    |sy d|fg}| j                  d|       y )Nr  zc:majorTickMarkr  r  s      r^   r8  zChart._write_major_tick_mark$
  &     cl^
-z:r_   c                 8    |sy d|fg}| j                  d|       y )Nr  zc:minorTickMarkr  r  s      r^   r9  zChart._write_minor_tick_mark.
  rp  r_   c                 D    ||dk(  rd}d|fg}| j                  d|       y )Nnext_tonextTor  zc:tickLblPosr  r  s      r^   r:  zChart._write_tick_label_pos8
  s.    ;#*Ccl^
NJ7r_   c                 2    d|fg}| j                  d|       y )Nr  z	c:crossAxr  r  s      r^   r<  zChart._write_cross_axisA
       cl^
K4r_   c                 :    |d}d|fg}| j                  d|       y )NautoZeror  z	c:crossesr  r  s      r^   r=  zChart._write_crossesH
  s'    ;Ccl^
K4r_   c                 2    d|fg}| j                  d|       y )Nr  zc:crossesAtr  r  s      r^   r>  zChart._write_c_crosses_atQ
       cl^
M:6r_   c                 2    d|fg}| j                  d|       y )Nr  zc:autor  r  s      r^   r?  zChart._write_autoX
  r0  r_   c                 V    |d}|dk(  rd}|dk(  rd}d|fg}| j                  d|       y )Nctrr|  rb  leftr   r  z	c:lblAlgnr  r  s      r^   r@  zChart._write_label_align_
  sA     ;C'>C&=Ccl^
K4r_   c                 2    d|fg}| j                  d|       y )Nr  zc:lblOffsetr  r  s      r^   rA  zChart._write_label_offseto
  rz  r_   c                 8    |y d|fg}| j                  d|       y )Nr  zc:tickLblSkipr  r  s      r^   rB  zChart._write_c_tick_lbl_skipv
  s%    ;cl^
OZ8r_   c                 8    |y d|fg}| j                  d|       y )Nr  zc:tickMarkSkipr  r  s      r^   rC  zChart._write_c_tick_mark_skip
  s&    ;cl^
,j9r_   c                     |sy |d   sy |d   d   r4| j                  d       | j                  |       | j                  d       y | j                  d       y )Nr   ry   r  zc:majorGridlinesr  r   r   r  r\   	gridliness     r^   r5  zChart._write_major_gridlines
  _     #VY' 23 i(01 23r_   c                     |sy |d   sy |d   d   r4| j                  d       | j                  |       | j                  d       y | j                  d       y )Nr   ry   r  zc:minorGridlinesr  r  s     r^   r6  zChart._write_minor_gridlines
  r  r_   c                 N    || j                   }d|fg}| j                  d|       y )Nr  zc:crossBetween)rF   r  r  s      r^   rI  zChart._write_cross_between
  s.    ;$$Ccl^
,j9r_   c                 8    |sy d|fg}| j                  d|       y )Nr  zc:majorUnitr  r  s      r^   rJ  zChart._write_c_major_unit
  %     cl^
M:6r_   c                 8    |sy d|fg}| j                  d|       y )Nr  zc:minorUnitr  r  s      r^   rK  zChart._write_c_minor_unit
  r  r_   c                 :    |d}d|fg}| j                  d|       y )Ndaysr  zc:majorTimeUnitr  r  s      r^   rP  zChart._write_c_major_time_unit
  (    ;Ccl^
-z:r_   c                 :    |d}d|fg}| j                  d|       y )Nr  r  zc:minorTimeUnitr  r  s      r^   rQ  zChart._write_c_minor_time_unit
  r  r_   c                 z   | j                   }|j                  dd      }|j                  d      }g }d}|j                  d      rt        |d   t              r|d   }|j	                  d      r|j                  dd      }d}d	d
dddd}|dk(  ry ||vry ||   }| j                  d       | j                  |       |D ]  }| j                  |        | j                  |j                  d      d       |r| j                          |r| j                  |       | j                  |       | j                  d       y )Nr   r|  r   r   r}  overlay_r   r
   rb  r   rc  r   tr)r|  r~  topbottom	top_rightr   zc:legendr   r,   )r,   r   r%  r&  r8  replacer  _write_legend_pos_write_legend_entryr  _write_overlay_write_tx_prr   r   )r\   r,   r   r   r}  r   allowedr  s           r^   r  zChart._write_legend
  sN   ::j'2zz&!::o&:f_6Mt+T"?3Mz*''
B7HG 
 v7"8$J' 	x( # 	,E$$U+	,
 	6::h/: !d# 	&!*%r_   c                 2    d|fg}| j                  d|       y )Nr  zc:legendPosr  r  s      r^   r  zChart._write_legend_pos  rz  r_   c                     | j                  d       | j                  |       | j                  d       | j                  d       y )Nzc:legendEntryr
   )r  r  r3  r   )r\   r  s     r^   r  zChart._write_legend_entry  s>     	O, 	 	1/*r_   c                 6    d}d|fg}| j                  d|       y )Nr
   r  z	c:overlayr  r  s      r^   r  zChart._write_overlay)  "    cl^
K4r_   c                 P    d}| j                   ry d|fg}| j                  d|       y )Nr
   r  zc:plotVisOnly)r=   r  r  s      r^   r  zChart._write_plot_vis_only1  s0     cl^
OZ8r_   c                     | j                  d       | j                          | j                          | j                          | j	                  d       y )Nzc:printSettings)r  _write_header_footer_write_page_margins_write_page_setupr   r   s    r^   r   zChart._write_print_settings=  sJ    -. 	!!# 	  " 	 +,r_   c                 &    | j                  d       y )Nzc:headerFooterr  r   s    r^   r  zChart._write_header_footerL  s    ,-r_   c                 h    d}d}d}d}d}d}d|fd|fd|fd|fd|fd	|fg}| j                  d
|       y )Ng      ?gffffff?g333333?r   r   rb  rc  headerfooterzc:pageMarginsr  )r\   r  r~  r|  r  r  r  r  s           r^   r  zChart._write_page_marginsP  sg     &M$K%L#Jvv

 	OZ8r_   c                 &    | j                  d       y )Nzc:pageSetupr  r   s    r^   r  zChart._write_page_setupd  s    M*r_   c                 *    | j                  ddg       y )Nzc:autoTitleDeletedr  r  r   s    r^   r  z!Chart._write_c_auto_title_deletedh  s    0:,?r_   rP   rE  c                     |j                         r| j                  ||       y |j                         r| j                  ||       y |j	                         r| j                  |       y y r  )has_name_write_title_richhas_formula_write_title_formulahas_formatting_write_title_format_onlyr\   rP   rE  s      r^   r  zChart._write_titlel  sW    >>""5-8 %%e];!!#))%0 $r_   c                 D   | j                  d       | j                  |j                  ||j                         | j	                  |j
                  d       |j                  r| j                          | j                  |j                                | j                  d       y Nzc:titler  )r  _write_tx_richre   r   r  r   r   r  r   get_formattingr   r  s      r^   r  zChart._write_title_richu  s~    I& 	EJJuzzB 	5<<0 ==! 	%..01)$r_   c                 z   | j                  d       | j                  |j                  |j                         | j	                  |j
                  d       |j                  r| j                          | j                  |j                                | j                  |j                  |       | j                  d       y r  )r  r  r   r   r  r   r   r  r   r  r  r   r   r  s      r^   r  zChart._write_title_formula  s     	I& 	u}}emm< 	5<<0 ==! 	%..01 	%**m4)$r_   c                     | j                  d       | j                  |j                  d       |j                  r| j	                          | j                  |j                                | j                  d       y r  )r  r  r   r   r  r   r  r   r\   rP   s     r^   r  zChart._write_title_format_only  sb    I& 	5<<0 ==! 	%..01)$r_   c                 r    | j                  d       | j                  |||d       | j                  d       y )Nc:txF)ignore_rich_pr)r  _write_richr   )r\   rP   rE  r   s       r^   r  zChart._write_tx_rich  s9     	F# 	mEJ&!r_   c                 j    | j                  d       | j                  |       | j                  d       y )Nr  r  _write_vr   r  s     r^   r  zChart._write_tx_value  s.     	F# 	e&!r_   c                     d }|| j                   |   }| j                  d       | j                  ||d       | j                  d       y )Nr  r/  )r0   r  r  r   )r\   rP   r   r   s       r^   r  zChart._write_tx_formula  sM    $$W-DF# 	E4/&!r_   c                     |r|j                  d      |d   }nd }| j                  d       | j                  ||       | j                          | j	                  |||       | j                  d       y )Nr  zc:rich)r   r  _write_a_body_pr_write_a_lst_style_write_a_p_richr   )r\   rP   r   rE  r  r  s         r^   r  zChart._write_rich  st     DHHZ(4J'HHH% 	h6 	! 	UD.9(#r_   c                 $   g }||rd}|t|dk(  r#|j                  d       |j                  d       nL|dk(  r#|j                  d       |j                  d       n$|j                  d|f       |j                  d       | j                  d	|       y )
Ni@i@1 )rotr   )vertwordArtVerti )r  eaVertr  )r  horzza:bodyPr)r   r  )r\   r  rE  r  s       r^   r  zChart._write_a_body_pr  s    
H8#!!*-!!"9:X%!!*-!!"45!!5("34!!"23J
3r_   c                 &    | j                  d       y )Nz
a:lstStyler  r   s    r^   r  zChart._write_a_lst_style  s    L)r_   c                     | j                  d       |s| j                  |       | j                  ||       | j                  d       y Na:p)r  _write_a_p_pr_rich
_write_a_rr   )r\   rP   r   r  s       r^   r  zChart._write_a_p_rich  sC     	E" ##D) 	t$% r_   c                     | j                  d       | j                  |       | j                          | j                  d       y r  )r  r  _write_a_end_para_rprr   r\   r   s     r^   _write_a_p_formulazChart._write_a_p_formula  s>     	E" 	% 	""$% r_   c                 j    | j                  d       | j                  |       | j                  d       y )Nza:pPr)r  _write_a_def_rprr   r  s     r^   r  zChart._write_a_p_pr_rich  s0     	G$ 	d#'"r_   c                 P   d}t        j                  |      }t        j                  |      }|r|j                  d      rd}|s|rO| j	                  d|       |r| j                  d|d   i       |r| j                  |       | j                  d       y | j                  d|       y )NFr  Tza:defRPr)	r   _get_font_style_attributes_get_font_latin_attributesr   r  r  _write_a_latinr   r  )r\   r   	has_colorstyle_attributeslatin_attributess        r^   r  zChart._write_a_def_rpr&  s    	 ;;DA ;;DADHHW%Iy
,<=(('4=)AB##$45j)
,<=r_   c                 6    d}d|fg}| j                  d|       y )Nr  langza:endParaRPrr  )r\   r  r  s      r^   r  zChart._write_a_end_para_rpr=  s#    tn%
NJ7r_   c                     | j                  d       | j                  |       | j                  |       | j                  d       y )Nza:r)r  _write_a_r_pr
_write_a_tr   )r\   rP   r   s      r^   r  zChart._write_a_rE  s>     	E" 	4  	% r_   c                 d   d}d}t        j                  |      }t        j                  |      }|r|d   rd}|j                  dd|f       |s|rO| j	                  d|       |r| j                  d|d   i       |r| j                  |       | j                  d       y | j                  d|       y )NFr  r  Tr   r  za:rPr)	r   r  r  insertr  r  r  r   r  )r\   r   r  r  r  r  s         r^   r  zChart._write_a_r_prR  s    	 ;;DA ;;DADMI 	FD>2y)9:(('4=)AB##$45g&)9:r_   c                 (    | j                  d|       y )Nza:tr+  r  s     r^   r  zChart._write_a_tm  s     	ue,r_   c                     |r|j                  d      |d   }nd }| j                  d       | j                  ||       | j                          | j	                  |       | j                  d       y )Nr  c:txPr)r   r  r  r  r  r   )r\   r   rE  r  s       r^   r  zChart._write_tx_prr  sp     DHHZ(4J'HHH% 	h6 	! 	%(#r_   c                    || j                   }|sy |d   dk(  ry | j                  d       | j                  |d          |j                  d      r| j	                  |d          | j                  |       | j                  d       y )NrI  r<  zc:markerr  )rG   r  _write_symbolr   _write_marker_sizer   r   )r\   rl   s     r^   r  zChart._write_marker  s    >((F&>[(J' 	6&>* ::f##F6N3 	&!*%r_   c                 2    d|fg}| j                  d|       y )Nr  zc:sizer  r  s      r^   r  zChart._write_marker_size  r0  r_   c                 2    d|fg}| j                  d|       y )Nr  zc:symbolr  r  s      r^   r  zChart._write_symbol       cl^
J
3r_   chart_formatc                    | j                  |      sy | j                  d       |j                  d      r4|d   d   r,d|d   v r| j                          n| j	                  |d          |j                  d      r| j                  |d          |j                  d      r| j                  |d          |j                  d      r|d   d   r| j                  |d          | j                  d       y )Nc:spPrr[   r  r   rj   rk   ry   )	r  r  r   _write_a_no_fillr  _write_a_patt_fill_write_a_grad_fill_write_a_lnr   )r\   r  s     r^   r   zChart._write_sp_pr  s    ##L1H% F#V(<Y(Gf--%%' ((f)=>I&##L$;<J'##L$<= F#V(<Y(G\&12(#r_   c                    g }|j                  d      }|*t        |dz   dz        dz  }t        dd|z  z         }d|fg}|j                  d      s"|j                  d	      s|j                  d
      rr| j                  d|       d|v r| j                          nd	|v r| j	                  |       |j                  d
      }|r| j                  |       | j                  d       y | j                  d|       y )Nr?   g      ?   g      @g      ?i1  wr   r  	dash_typeza:ln)r   r"  r  r  r  _write_a_prst_dashr   r  )r\   ry   r  r?   	line_types        r^   r  zChart._write_a_ln  s    
 !!+,s2E uu}-.E,J88Ftxx0DHH[4I
3 ~%%'D((. -I''	2f%
3r_   c                 &    | j                  d       y )Nza:noFillr  r   s    r^   r  zChart._write_a_no_fill  s    J'r_   c                     | j                  d       |j                  d      r$| j                  |d   |j                  d             | j                  d       y )Nza:solidFillr  transparency)r  r   _write_colorr   )r\   r[   s     r^   r  zChart._write_a_solid_fill  sI     	M*88Gd7mTXXn-EF-(r_   c                    |sy |j                   r| j                          y |j                  t        j                  k(  r| j                  ||       y |j                  t        j                  k(  r| j                  ||       y y r  )_is_automatic_write_a_sys_clr_typer	   RGB_write_a_srgb_clrTHEME_write_a_scheme_clr)r\   r  r  s      r^   r   zChart._write_color  sf     !!#[[JNN*""5,7[[J,,,$$UL9 -r_   c                 @    d}d}d|fd|fg}| j                  d|       y )NwindowFFFFFFr  lastClrza:sysClrr  )r\   r  last_clrr  s       r^   r  zChart._write_a_sys_clr  s8      CL!


 	J
3r_   c                     |sy d|j                         fg}|r5| j                  d|       | j                  |       | j                  d       y | j	                  d|       y )Nr  z	a:srgbClr)_rgb_hex_valuer  _write_a_alphar   r  )r\   r  r  r  s       r^   r  zChart._write_a_srgb_clr  sa     e22456
Z8 -k*Z8r_   c                 8   |j                         \  }}}d|fg}|dkD  s|dkD  s|rc| j                  d|       |dkD  r| j                  |       |dkD  r| j                  |       |r| j	                  |       | j                  d       y | j                  d|       y )Nr  r   za:schemeClr)_chart_schemer  _write_a_lum_mod_write_a_lum_offr  r   r  )r\   r  r  schemelum_modlum_offr  s          r^   r  zChart._write_a_scheme_clr-  s    #(#6#6#8 fo&
Q;'A+z:{%%g.{%%g.##L1m,z:r_   r^  c                 2    d|fg}| j                  d|       y )Nr  za:lumModr  r\   r^  r  s      r^   r  zChart._write_a_lum_modE      en%
J
3r_   c                 2    d|fg}| j                  d|       y )Nr  za:lumOffr  r  s      r^   r  zChart._write_a_lum_offK  r  r_   c                 f    t        dt        |      z
  dz        }d|fg}| j                  d|       y )Nr   r  r  za:alphar"  r  r  s      r^   r  zChart._write_a_alphaQ  s6     3S>T)*cl^
Iz2r_   c                 2    d|fg}| j                  d|       y )Nr  z
a:prstDashr  r  s      r^   r  zChart._write_a_prst_dashZ  s     cl^
L*5r_   c                    |sy | j                  d       | j                  |j                  d             | j                  |       | j	                  |d          |d   dk(  r | j                  |j                  d             |d   dk(  r | j                  |j                  d             | j                  |j                  d             | j                  |j                  d	             d
|v r| j                  |d
          |j                  d      r| j                          |j                  d      r!| j                          | j                  |       | j                  d       y )Nzc:trendlinere   rI  rR  orderrQ  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\   rm   s     r^   r  zChart._write_trendlinea  s?    M* 	v./ 	)$ 	""9V#45 V&''	g(>? V+y}}X67 	IMM)45 	Y]]:67)###Ik$:;==,-##%==+,!!# ''	2-(r_   c                 2    d|fg}| j                  d|       y )Nr  zc:trendlineTyper  r  s      r^   r(  zChart._write_trendline_type  s      cl^
-z:r_   c                 .    |y | j                  d|       y )Nzc:namer  r\   r   s     r^   r'  zChart._write_name  s     <x.r_   c                 J    t        |d      }d|fg}| j                  d|       y )Nr   r  r  r   r  r  s      r^   r)  zChart._write_trendline_order  s(    #qkcl^
Iz2r_   c                 J    t        |d      }d|fg}| j                  d|       y )Nr   r  zc:periodr5  r  s      r^   r*  zChart._write_period  s(    #qkcl^
J
3r_   c                 8    |sy d|fg}| j                  d|       y )Nr  z	c:forwardr  r  s      r^   r+  zChart._write_forward  rZ  r_   c                 8    |sy d|fg}| j                  d|       y )Nr  z
c:backwardr  r  s      r^   r,  zChart._write_backward  s%     cl^
L*5r_   c                 2    d|fg}| j                  d|       y )Nr  zc:interceptr  r  s      r^   r-  zChart._write_c_intercept  s    cl^
M:6r_   c                 .    dg}| j                  d|       y )Nr  zc:dispEqr  r\   r  s     r^   r/  zChart._write_c_disp_eq  s     \
J
3r_   c                 .    dg}| j                  d|       y )Nr  z
c:dispRSqrr  r;  s     r^   r.  zChart._write_c_disp_rsqr       \
L*5r_   c                    | j                  d       | j                  d d        | j                          | j                  |d          |d   r'|d   j	                  d      }|r| j                  |       | j                  d       y )Nzc:trendlineLblrW  r   )r  r  _write_trendline_num_fmtr   r   r;  r   )r\   rm   r   s      r^   r0  zChart._write_c_trendline_lbl  s    ,- 	4& 	%%' 	)G,- WW%))&1D%%d+*+r_   c                 0    ddg}| j                  d|       y )N)rf  r  )rg  r   rh  r  r;  s     r^   r?  zChart._write_trendline_num_fmt  s#     &


 	J
3r_   c                     | j                   }|y d|v r<|d   d   r4| j                  d       | j                  |       | j                  d       y | j	                  d       y )Nry   r  zc:hiLowLines)rM   r  r   r   r  )r\   rM   s     r^   _write_hi_low_lineszChart._write_hi_low_lines  sd    ((\!l6&:9&E/ l+n-/r_   c                     | j                   }|y |d   d   r4| j                  d       | j                  |       | j                  d       y | j	                  d       y )Nry   r  zc:dropLines)rL   r  r   r   r  )r\   rL   s     r^   _write_drop_lineszChart._write_drop_lines  s[    __
fi(. j)m,.r_   c                 8    |y d|fg}| j                  d|       y )Nr  z	c:overlapr  r  s      r^   _write_overlapzChart._write_overlap  s'     ;cl^
K4r_   c                 :   |rt        |      }nd}| j                  d       | j                  d       | j                  |       t	        |      D ](  }||   }|	 t        |       | j                  ||       * | j                  d       y # t        $ r d}Y 3w xY w)Nr   z
c:numCacher  	r~   r  _write_format_coder#  ranger2  r3  r&  r   r\   r   r'  r)  r4  s        r^   r  zChart._write_num_cache   s    IEEL) 		* 	U#u 	%AGE}e NN1e$	% 	,'  s   BBBc                     t        |      }| j                  d       | j                  |       t        |      D ]  }| j	                  |||           | j                  d       y )Nz
c:strCache)r~   r  r#  rJ  r&  r   )r\   r   r'  r)  s       r^   r  zChart._write_str_cache@  s^    D	L) 	U#u 	'ANN1d1g&	' 	,'r_   c                 (    | j                  d|       y )Nzc:formatCoder  r3  s     r^   rI  zChart._write_format_codeO  s     	~t4r_   c                 2    d|fg}| j                  d|       y )Nr  z	c:ptCountr  r  s      r^   r#  zChart._write_pt_countT  rv  r_   c                 |    |y d|fg}| j                  d|       | j                  |       | j                  d       y )Nidxzc:ptr  )r\   rP  r^  r  s       r^   r&  zChart._write_pt[  sC     =cl^
FJ/ 	e&!r_   c                 (    | j                  d|       y )Nzc:vr  r3  s     r^   r  zChart._write_vj  s     	ud+r_   c                 @    | j                   sy | j                  d       y )Nzc:protection)r3   r  r   s    r^   r   zChart._write_protectiono  s    N+r_   c                 P    d}|sy |D ]  }|dz  }|s| j                  ||        y )Nr   r
   )_write_d_pt_point)r\   rq   r  r  s       r^   r  zChart._write_d_ptv  s;     	1EQJE""5%0	1r_   c                     | j                  d       | j                  |       | j                  |       | j                  d       y )Nzc:dPt)r  r  r   r   )r\   r  r  s      r^   rT  zChart._write_d_pt_point  s>     	G$ 	 	% '"r_   c                 p   |sy | j                  d       |j                  d      r| j                  ||d          |j                  d      r| j                  |d          | j	                  |       |j                  d      r| j                  |d          |j                  d      r| j                  |d          |j                  d      r| j                          |j                  d      r| j                          |j                  d      r| j                          |j                  d	      r| j                          |j                  d
      r| j                          |j                  d      r| j                  |d          |j                  d      r| j                          | j                  d       y )Nzc:dLblsrh  r   r   r   
legend_keyr^  categoryseries_namera  rs  leader_lines)r  r   _write_custom_labelsrn  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\   rz   s     r^   r  zChart._write_d_lbls  sx    I& ::h%%ffX.>? ::l#001EF 	&! ::f!!&.1 ::j!!!&"45 ::l#'') ::g  " ::j!%%' ::m$%%' ::l#$$& ::k"!!&"56 ::n%))+)$r_   c                    d}|D ]  }|dz  }|d}| j                  d       | j                  |dz
         |j                  d      }|r| j                  d       n`|j                  d      s#|j                  d      s|j                  d      r| j	                  d d        |j                  d      r| j                  |       n$|j                  d      r| j                  |       d	}|r| j                  |       |j                  d      r| j                  |d          n%|j                  d      r| j                  |d          |j                  d      r| j                          |j                  d
      r| j                          |j                  d      r"| j                          n| j                  |       | j                  d        y )Nr   r
   Tzc:dLbldeleter   r^  r   FrX  rY  )r  r  r   r3  r  _write_custom_label_formula_write_custom_label_str_write_custom_label_formatr\  r^  r_  r`  r   )r\   parentrz   r  rW  use_custom_formattingdelete_labels          r^   r[  zChart._write_custom_labels  s    2	(EQJE}$(!) OOEAI& 99X.L""1%9%7);uyy?T ""4.99Y'44U;YYw'007,1)(33E:99Z())%
*;<ZZ
+))&*<=::g&((*::j)--/::m,--/ //6h'e2	(r_   c                     |j                  d      }|j                  d      }| j                  |      }| j                  d       | j                  ||d|        | j	                  d       | j                  |       y )Nr^  r   r  F)r   r  r  r  r   r   )r\   rW  rP   r   r  s        r^   rg  zChart._write_custom_label_str  ss    		'"yy --e4F# 	e-?@&! 	% r_   c                     |j                  d      }|j                  d      }d }|| j                  |   }| j                  d       | j                  ||d       | j	                  d       y )Nr   r   r  r/  )r   r0   r  r  r   )r\   rW  r   r   r   s        r^   rf  z!Chart._write_custom_label_formula  si    ))I&))I&$$W-DF# 	GT51&!r_   c                     |j                  d      }| j                  |      }|r#| j                  |       | j                  |       y |r#| j	                  d       | j                  |       y y )Nr   r  )r   r  r   r  r  )r\   rW  r   r  s       r^   rh  z Chart._write_custom_label_format"  sc    yy --e4e$d#)d# r_   c                 6    d}d|fg}| j                  d|       y )Nr  r  zc:showLegendKeyr  r  s      r^   r]  zChart._write_show_legend_key.  s#    cl^
-z:r_   c                 6    d}d|fg}| j                  d|       y )Nr
   r  z	c:showValr  r  s      r^   r^  zChart._write_show_val6  r  r_   c                 6    d}d|fg}| j                  d|       y )Nr
   r  zc:showCatNamer  r  s      r^   r_  zChart._write_show_cat_name>  "    cl^
OZ8r_   c                 6    d}d|fg}| j                  d|       y )Nr
   r  zc:showSerNamer  r  s      r^   r`  zChart._write_show_ser_nameF  rr  r_   c                 6    d}d|fg}| j                  d|       y )Nr
   r  zc:showPercentr  r  s      r^   ra  zChart._write_show_percentN  rr  r_   c                 (    | j                  d|       y )Nzc:separatorr  r3  s     r^   rb  zChart._write_separatorV  s    }d3r_   c                     d}d}d|fd|fg}| j                  d       | j                  d|       | j                  ddg       | j                  d       | j                  d       y )	Nz&{CE6537A1-D6FC-4f65-9D91-7224C49458BB}z6http://schemas.microsoft.com/office/drawing/2012/chartr   z	xmlns:c15r  r  zc15:showLeaderLinesr  r  )r\   r   
xmlns_c_15r  s       r^   rc  zChart._write_show_leader_linesZ  su     7M
 CL*%


 	J'GZ01J<@'"*%r_   c                 2    d|fg}| j                  d|       y )Nr  z	c:dLblPosr  r  s      r^   r\  zChart._write_d_lbl_posn  rv  r_   c                 2    d|fg}| j                  d|       y )Nr  zc:deleter  r  s      r^   r3  zChart._write_deleteu  r  r_   c                 <    d}|sy d|fg}| j                  d|       y )Nr
   r  zc:invertIfNegativer  )r\   invertr  r  s       r^   r  z!Chart._write_c_invert_if_negative|  s)    cl^
0*=r_   c                 6   |sy | j                  d       | j                  |j                  d      d        | j                          | j                  d       | j	                  |       | j                          | j                  d       | j                  d       y )Nr  r  r  )r  r  r   r  r  r  r   r  s     r^   r;  zChart._write_axis_font  s     H%dhhz2D9!E"%""$% (#r_   c                 (    | j                  d|       y )Nza:latinr  r;  s     r^   r  zChart._write_a_latin  s    Iz2r_   c                 @   | j                   }|sy | j                  d       |d   r| j                          |d   r| j                          |d   r| j	                          |d   r| j                          |d   r| j                  |d          | j                  d       y )Nzc:dTabler   r   r   r   r   )rE   r  _write_show_horz_border_write_show_vert_border_write_show_outline_write_show_keysr  r   )r\   rE   s     r^   r  zChart._write_d_table  s    

J'((*((*$$&!!#=eFm,*%r_   c                 .    dg}| j                  d|       y )Nr  zc:showHorzBorderr  r;  s     r^   r  zChart._write_show_horz_border       \
.
;r_   c                 .    dg}| j                  d|       y )Nr  zc:showVertBorderr  r;  s     r^   r  zChart._write_show_vert_border  r  r_   c                 .    dg}| j                  d|       y )Nr  zc:showOutliner  r;  s     r^   r  zChart._write_show_outline  s     \
OZ8r_   c                 .    dg}| j                  d|       y )Nr  z
c:showKeysr  r;  s     r^   r  zChart._write_show_keys  r=  r_   c                 t    |sy |d   r| j                  d|d          |d   r| j                  d|d          y y )Nrp   r@  ro   r  )_write_err_barsr\   r}   s     r^   r  zChart._write_error_bars  sI     n%  j&@An%  j&@A &r_   c                 z   |sy | j                  d       | j                  |       | j                  |d          | j                  |d          |d   s| j	                          |d   dk(  rn.|d   dk(  r| j                  |       n| j                  |d          | j                  |       | j                  d       y )Nz	c:errBarsr`  rI  r_  rc  rd  r^  )	r  _write_err_dir_write_err_bar_type_write_err_val_type_write_no_end_cap_write_custom_error_write_error_valr   r   )r\   r`  r}   s      r^   r  zChart._write_err_bars  s     K( 	I& 	  K!89 	  F!34(#""$f)6)$$Z0 !!*W"56 	*%+&r_   c                 2    d|fg}| j                  d|       y )Nr  zc:errDirr  r  s      r^   r  zChart._write_err_dir  r  r_   c                 2    d|fg}| j                  d|       y )Nr  zc:errBarTyper  r  s      r^   r  zChart._write_err_bar_type
       cl^
NJ7r_   c                 2    d|fg}| j                  d|       y )Nr  zc:errValTyper  r  s      r^   r  zChart._write_err_val_type  r  r_   c                 .    dg}| j                  d|       y )Nr  z
c:noEndCapr  r;  s     r^   r  zChart._write_no_end_cap  r=  r_   c                 2    d|fg}| j                  d|       y )Nr  r  r  r  s      r^   r  zChart._write_error_val  r  r_   c                    |d   rc| j                  d       t        |d   t              r| j                  |d          n| j	                  |d   |d   d       | j                  d       |d   rd| j                  d       t        |d   t              r| j                  |d          n| j	                  |d   |d   d       | j                  d       y y )Nrk  zc:plusrm  r0  rl  zc:minusrn  )r  r%  r&  _write_num_litr  r   r  s     r^   r  zChart._write_custom_error%  s     m$)*]3T:##J}$=>##}-z+/F h'n%	**^4d;##J~$>?##~.
<0H% i( &r_   c                 0   t        |      }| j                  d       | j                  d       | j                  |       t	        |      D ](  }||   }|	 t        |       | j                  ||       * | j                  d       y # t        $ r d}Y 3w xY w)Nzc:numLitr  r   rH  rK  s        r^   r  zChart._write_num_lit@  s    D	 	J' 		* 	U#u 	%AGE}e NN1e$	% 	*%  s   BBBc                    | j                   }|y | j                  d       | j                  d       | j                  |j	                  d             | j                  |j	                  d             | j                  d       y )Nzc:upDownBars   r   r   )rN   r  _write_gap_width_write_up_barsr   _write_down_barsr   )r\   rN   s     r^   _write_up_down_barszChart._write_up_down_bars^  sx    ((N+ 	c" 	L,,T23 	l..v67.)r_   c                 8    |y d|fg}| j                  d|       y )Nr  z
c:gapWidthr  r  s      r^   r  zChart._write_gap_widthr  s'     ;cl^
L*5r_   c                     |d   r<|d   d   r4| j                  d       | j                  |       | j                  d       y | j                  d       y )Nry   r  zc:upBarsr  r\   
bar_formats     r^   r  zChart._write_up_bars|  sR     f*V"4Y"?
+ j)j)
+r_   c                     |d   r<|d   d   r4| j                  d       | j                  |       | j                  d       y | j                  d       y )Nry   r  z
c:downBarsr  r  s     r^   r  zChart._write_down_bars  sR     f*V"4Y"?- j)l+-r_   c                     |sy d|fg}| j                  d       | j                  d|       |r3| j                  d       | j                  d       | j                  d       | j                  d       y )Nr  zc:dispUnitszc:builtInUnitzc:dispUnitsLblr  r  )r\   unitsdisplayr  s       r^   rL  zChart._write_disp_units  sq     en%
M*OZ8 01
+./-(r_   c                    ddg}|d   dk(  rg }| j                  d|       | j                  |       |d   dk(  r| j                  |d          n(| j                  |d          | j	                  |d          | j                  d       y )N)flipr   )rotWithShaper  rI  rO  z
a:gradFillangle)r  _write_a_gs_lst_write_a_lin_write_a_path_write_a_tile_rectr   )r\   rk   r  s      r^   r  zChart._write_a_grad_fill  s     '(=>
Fx'JL*5 	X&Fx'hw/0 x/0 ##HV$45,'r_   c                    |d   }|d   }| j                  d       t        |      D ]O  \  }}t        ||   dz        }d|fg}| j                  d|       | j                  |       | j	                  d       Q | j	                  d       y )N	positionscolorsza:gsLstr  posza:gs)r  r%  r"  r   r   )r\   rk   r  r  r)  r  r  r  s           r^   r  zChart._write_a_gs_lst  s    [)	(#I&!&) 	&HAuilT)*C #,J
3e$f%	& 	)$r_   c                 P    t        d|z        }d|fdg}| j                  d|       y )Nr!  ang)scaled0za:linr  )r\   r  r  s      r^   r  zChart._write_a_lin  s7     EEM" EN


 	GZ0r_   c                 v    d|fg}| j                  d|       | j                  |       | j                  d       y )Npathza:path)r  _write_a_fill_to_rectr   r\   gradient_typer  s      r^   r  zChart._write_a_path  s?     }-.
Hj1 	""=1(#r_   c                 D    |dk(  rg d}nddg}| j                  d|       y )Nshape))r   50000)rc  r  )rb  r  )r   r  )r   100000)rc  r  za:fillToRectr  r  s      r^   r  zChart._write_a_fill_to_rect  s4     G#J  J
 	NJ7r_   c                 @    |dk(  rg }nddg}| j                  d|       y )Nr  )rb  -100000)r   r  z
a:tileRectr  r  s      r^   r  zChart._write_a_tile_rect  s2     G#J ! J
 	L*5r_   c                     d|d   fg}| j                  d|       | j                  |d          | j                  |d          | j                  d       y )Nprstrj   z
a:pattFillfg_colorbg_color)r  _write_a_fg_clr_write_a_bg_clrr   )r\   rj   r  s      r^   r  zChart._write_a_patt_fill
  s^     wy123
L*5 	WZ01 	WZ01,'r_   c                 j    | j                  d       | j                  |       | j                  d       y )Nza:fgClrr  r   r   r\   r  s     r^   r  zChart._write_a_fg_clr  ,    I&% )$r_   c                 j    | j                  d       | j                  |       | j                  d       y )Nza:bgClrr  r  s     r^   r  zChart._write_a_bg_clr  r  r_   )r   Nr  )r   )F)__name__
__module____qualname____doc__r   r   r   r/  r   r   r   r   r   r   r   r   r   r   r"  r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r5  r   r   r   rX  r   r  r   r   r   r   r   dictboolr  r  r  r  r  r  rZ   r   r   r   r   r  r  r  r  r  r  r  r  r   r  r  r  r  r  r  r  r  r  r  r  r  r.  r-  r  r  rN  r  r2  rS  rT  rU  rV  r4  rH  r7  rn  r8  r9  r:  r<  r=  r>  r?  r@  rA  rB  rC  r5  r6  rI  rJ  rK  rP  rQ  r  r  r  r  r  r   r  r  r  r  r   r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r   r  r  r  r   r  r  r  r  r  r  r  r  r(  r'  r)  r*  r+  r,  r-  r/  r.  r0  r?  rB  rD  rF  r  r  rI  r#  r&  r  r   r  rT  r  r[  rg  rf  rh  r]  r^  r_  r`  ra  rb  rc  r\  r3  r  r;  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  rL  r  r  r  r  r  r  r  r  r  __classcell__)r]   s   @r^   r   r      s   DLM#(4S>": M#d M#^$sCx. T $sCx. T 4S> d 4S> d 07$sCx.!9 07T 07d;$sCx. ;T ;;DcN ;t ;<T#s(^ < <!# !d !&"S "T "2
%
 3c3h 8 3D 3*$sCx.!9 T 0'
c3h(@ '
D '
R%
htCH~&> %
$ %
N%
(4S>*B %
d %
NXg. $ ,BOb>"" c < D>@9v'R4l	}~"H.htCH~.F .`*X'RCt C C2(#%' N82
3%:
:F(P
*,*6 3#j&U &t &2&*131<!#F#& &".:/32Y%vY%vZ%xf&P'&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(+@1* 1T 1d 1%z %$ %SW %( 8=%%04%	%0%j %T % """$*4,*!!#>.8!;6-
$*&224$ $$ $<#4J():% :t :49u 9D 9$; ;d ;04c 4d 44c 4d 436.)`;/3456746,*40"/"5(@(5
5",
,1#7%r6(p! " 
$;59994&(54	>$"3&><<96
B"'H48861)6&<*(6,.)$(2%$
1
$8$6(%U %t %%U %t %r_   r   )r  r*  typingr   r   r   warningsr   xlsxwriter.colorr   r	   r   r   chart_titler   r  r   utilityr   r   r   r   r   	XMLwriterr   r  r_   r^   <module>r     sB     	 & &  .  #  FD%I FD%r_   