o
    È·e“
  ã                   @   s.   d dl mZ ddlmZ G dd„ dejƒZdS )é    )Úwarné   )Ú	chart_piec                       sB   e Zd ZdZd‡ fdd„	Zdd„ Zdd„ Zd	d
„ Zdd„ Z‡  Z	S )ÚChartDoughnutz?
    A class for writing the Excel XLSX Doughnut charts.


    Nc                    s$   t t| ƒ ¡  d| _d| _d| _dS )z
        Constructor.

        r   r   é2   N)Úsuperr   Ú__init__Úvary_data_colorÚrotationÚ	hole_size)ÚselfÚoptions©Ú	__class__© úP/var/www/ideatree/venv/lib/python3.10/site-packages/xlsxwriter/chart_doughnut.pyr      s   
zChartDoughnut.__init__c                 C   s:   |du rdS |dk s|dkrt d| ƒ dS t|ƒ| _dS )zŽ
        Set the Doughnut chart hole size.

        Args:
            size: 10 <= size <= 90.

        Returns:
            Nothing.

        Né
   éZ   z8Chart hole size %d outside Excel range: 10 <= size <= 90)r   Úintr   )r   Úsizer   r   r   Úset_hole_size%   s   ÿzChartDoughnut.set_hole_sizec                 C   s   |   |¡ d S ©N)Ú_write_doughnut_chart)r   Úargsr   r   r   Ú_write_chart_typeA   s   zChartDoughnut._write_chart_typec                 C   sF   |   d¡ |  ¡  | jD ]}|  |¡ q|  ¡  |  ¡  |  d¡ d S )Nzc:doughnutChart)Ú_xml_start_tagÚ_write_vary_colorsÚseriesÚ
_write_serÚ_write_first_slice_angÚ_write_c_hole_sizeÚ_xml_end_tag)r   r   Údatar   r   r   r   L   s   

z#ChartDoughnut._write_doughnut_chartc                 C   s   d| j fg}|  d|¡ d S )NÚvalz
c:holeSize)r   Ú_xml_empty_tag)r   Ú
attributesr   r   r   r    `   s   z ChartDoughnut._write_c_hole_sizer   )
Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r   r   r    Ú__classcell__r   r   r   r   r      s    r   N)Úwarningsr   Ú r   ÚChartPier   r   r   r   r   Ú<module>   s   