
k4Vdc           @   s  d  Z  d Z d d l m Z m Z m Z m Z m Z m Z m	 Z	 m
 Z
 m Z m Z m Z m Z m Z m Z m Z m Z d d l Td d l m Z d d l m Z m Z m Z m Z m Z m Z m Z m Z d d l m  Z  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, d d l- Z- y e. Wn! e/ k
 rmd d l0 m. Z. n Xe1 d  Z2 e1 d  Z3 e1 d  Z4 d   Z5 d f  d     YZ6 d f  d     YZ7 d f  d     YZ8 d e  f d     YZ9 d e$ f d     YZ: d e9 f d     YZ; d   Z< d    Z= d! f  d"     YZ> d# e> f d$     YZ? d% e> e; f d&     YZ@ d' e? e; f d(     YZA d) f  d*     YZB d+ e9 f d,     YZC d- e> eC f d.     YZD d/ d0 d1 d2 d3 d4 d5 d6 d7 d8 d9 d: g ZE d; d< d; d= d; d= d; d; d= d; d= d; g ZF d>   ZG d? e f d@     YZH eH   ZI dA dB dC dD dE dF dG dH dI dJ dK dL dM dN dO dP dQ dR dS dT dU dV f ZJ dW eD f dX     YZK dY e? eC f dZ     YZL d[ eL f d\     YZM d]   ZN d^   ZO d_   ZP d`   ZQ da   ZR db   ZS dc   ZT dd   ZU de   ZV df   ZW dg   ZX dh   ZY di   ZZ dj   Z[ dk   Z\ dl   Z] dm   Z^ dn   Z_ do   Z` dp   Za d S(q   s   3.3.0s  Collection of axes for charts.

The current collection comprises axes for charts using cartesian
coordinate systems. All axes might have tick marks and labels.
There are two dichotomies for axes: one of X and Y flavours and
another of category and value flavours.

Category axes have an ordering but no metric. They are divided
into a number of equal-sized buckets. Their tick marks or labels,
if available, go BETWEEN the buckets, and the labels are placed
below to/left of the X/Y-axis, respectively.

  Value axes have an ordering AND metric. They correspond to a nu-
  meric quantity. Value axis have a real number quantity associated
  with it. The chart tells it where to go.
  The most basic axis divides the number line into equal spaces
  and has tickmarks and labels associated with each; later we
  will add variants where you can specify the sampling
  interval.

The charts using axis tell them where the labels should be placed.

Axes of complementary X/Y flavours can be connected to each other
in various ways, i.e. with a specific reference point, like an
x/value axis to a y/value (or category) axis. In this case the
connection can be either at the top or bottom of the former or
at any absolute value (specified in points) or at some value of
the former axes in its own coordinate system.
i(   t   isNumbert   isNumberOrNonet   isListOfStringsOrNonet   isListOfNumberst   isListOfNumbersOrNonet   isColorOrNonet   OneOft	   isBooleant
   SequenceOft   isStringt   EitherOrt	   Validatort   NoneOrt   isInstanceOft   isNormalDatet   isNoneOrCallable(   t   *(   t
   normalDate(   t   Drawingt   Linet   PolyLinet   Rectt   Groupt   STATE_DEFAULTSt   _textBoxLimitst   _rotatedBoxLimits(   t   Widgett   TypedPropertyCollection(   t   Labelt   PMVLabel(   t   nextRoundNumber(   t
   ShadedRect(   t   Color(   t   isSeqN(   t   reducec      	   C   s   t  |  d d  rY | r/ | | | d  } n | d  } t t | d  |    }  n  t t t g  |  D]+ } g  | D] } | d  k	 rv | ^ qv ^ qi   }  t |   d k r | S| t t | |     S(   Ni    c         S   s   | |  | |  S(   N(    (   t   Tt   xt   specialt   func(    (    sl   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/reportlab/graphics/charts/axes.pyt   <lambda>9   t    c         S   s   |  | S(   N(    (   R#   R$   (    (    sl   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/reportlab/graphics/charts/axes.pyR'   ;   R(   c         S   s   t  t | |    S(   N(   t   listt   map(   t   et   f(    (    sl   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/reportlab/graphics/charts/axes.pyR'   <   R(   (   R!   R)   R*   t   filtert   lent   None(   t   VR$   t   defaultR&   R%   R,   (    (    sl   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/reportlab/graphics/charts/axes.pyt   _findMinMaxValue6   s    G c         C   s   t  |  | | t d | S(   s   find minimum over V[i][x]R%   (   R2   t   min(   R0   R$   R1   R%   (    (    sl   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/reportlab/graphics/charts/axes.pyt   _findMinA   s    c         C   s   t  |  | | t d | S(   s   find maximum over V[i][x]R%   (   R2   t   max(   R0   R$   R1   R%   (    (    sl   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/reportlab/graphics/charts/axes.pyt   _findMaxE   s    c         C   s:   x3 |  D]+ } y t  |  | k r& d SWq d SXq Wd S(   s   true if all values are inti    i   (   t   int(   t   valuest   v(    (    sl   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/reportlab/graphics/charts/axes.pyt   _allIntI   s     	t   AxisLineAnnotationc           B   s    e  Z d  Z d   Z d   Z RS(   s  Create a grid like line using the given user value to draw the line
    kwds may contain
    startOffset if true v is offset from the default grid start position
    endOffset   if true v is offset from the default grid end position
    scaleValue  True/not given --> scale the value
                otherwise use the absolute value
    lo          lowest coordinate to draw default 0
    hi          highest coordinate to draw at default = length
    drawAtLimit True draw line at appropriate limit if its coordinate exceeds the lo, hi range
                False ignore if it's outside the range
    all Line keywords are acceptable
    c         K   s   | |  _  | |  _ d  S(   N(   t   _vt   _kwds(   t   selfR9   t   kwds(    (    sl   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/reportlab/graphics/charts/axes.pyt   __init___   s    	c            s  |  j  j   } | j d t  } | j d t  } | j d t  } | j rc | j } | j } n | j } | j } | j d d   } | j d d   }	 | d  k s |	 d  k rXt	 t	 | d d   d d   }
 |
 r t
 |
 d  r |
   }
 n  |
 r+| d  k r|
 d } n  |	 d  k rU|
 d	 }	 qUqX| d  k r@d } n  |	 d  k rXd }	 qXn  | j d
 | j  | } | j d d  | } t | |  t | |  } } | j d t  } | j } | sd   | _ n  z|  j } | r| | } n | r| | } n  | j | | |	 | | j d d    } t
 | d  sM| j   n  | j |      | k  st  | k r| s~d  S  | k  r|   n |     f d   | _ n  | |  } x* | j   D] \ } } t | | |  qWWd  | | _ X| S(   Nt
   scaleValuet	   endOffsett   startt   endt   joinAxist   getGridDimst   __call__i    i   t   hit   lot   drawAtLimitc         S   s   |  S(   N(    (   R$   (    (    sl   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/reportlab/graphics/charts/axes.pyR'      R(   t   parentt   _tickValuesc            s     S(   N(    (   R$   (   t   d(    sl   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/reportlab/graphics/charts/axes.pyR'      R(   (   R=   t   copyt   popt   Truet   Falset   isYAxist   _xt   _yR/   t   getattrt   hasattrt   _lengthR3   R5   t   _get_line_posR<   t   _getLineFunct   _pseudo_configuret   itemst   setattr(   R>   t   axisR?   RA   RB   t   startOffsett   offst   d0t   sR+   t   dimRH   RI   RJ   t   oaglpR9   R&   t   Lt   k(    (   RM   sl   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/reportlab/graphics/charts/axes.pyRG   c   sj    				   	 		) 	
(   t   __name__t
   __module__t   __doc__R@   RG   (    (    (    sl   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/reportlab/graphics/charts/axes.pyR;   R   s   	t   AxisBackgroundAnnotationc           B   s    e  Z d  Z d   Z d   Z RS(   s  Create a set of coloured bars on the background of a chart using axis ticks as the bar borders
    colors is a set of colors to use for the background bars. A colour of None is just a skip.
    Special effects if you pass a rect or Shaded rect instead.
    c         K   s   | |  _  | |  _ d  S(   N(   t   _colorsR=   (   R>   t   colorsR?   (    (    sl   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/reportlab/graphics/charts/axes.pyR@      s    	c      
   C   sN  |  j  } | s d  S|  j j   } | j } | rF | j } | j } n | j } | j } | j d d   } | j d d   } | d  k s | d  k r;t t | d d   d d   }	 |	 r t	 |	 d  r |	   }	 n  |	 r| d  k r |	 d } n  | d  k r8|	 d } q8q;| d  k r#d } n  | d  k r;d } q;n  t	 | d  sW| j
   n  t | d d   }
 |
 ssd  St   } t |  } | j |
 d  } xt d t |
   D]} | j |
 |  } | | d | } | r@| r| } | } | | } | | } n  | } | } | | } | | } t | t  r^t | | | | d	 | d
 d  } n t | t  rt | | | |  } x | j D]. } | d k rt | | t | |   qqWno t | t  r0t d | d | d | d |  } x< | j D]. } | d k rt | | t | |   qqWn  | j |  n  | } qW| S(   NRC   RD   RE   RF   RG   i    i   RL   t	   fillColort   strokeColorR$   t   yt   widtht   height(   R$   Rn   Ro   Rp   (   R$   Rn   Ro   Rp   (   Rj   R=   RN   RR   RS   RT   RO   R/   RU   RV   RZ   R   R.   RX   t   ranget
   isinstanceR    R   t   __dict__R\   R   t   add(   R>   R]   Rk   R?   RR   R_   R`   Ra   R+   Rb   t   tvt   Gt   ncolorst   v0t   it   v1t   cRn   R$   Rp   Ro   t   rRe   (    (    sl   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/reportlab/graphics/charts/axes.pyRG      sz    	 				   	  	


$#!#
(   Rf   Rg   Rh   R@   RG   (    (    (    sl   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/reportlab/graphics/charts/axes.pyRi      s   	t   TickLUc           B   s)   e  Z d  Z d   Z d   Z d   Z RS(   s$   lookup special cases for tick valuesc         O   s"   | j  d d  |  _ | |  _ d  S(   Nt   accuracyg:0yE>(   RO   R~   R#   (   R>   R#   R?   (    (    sl   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/reportlab/graphics/charts/axes.pyR@      s    c         C   sA   |  j  } x1 |  j D]& \ } } t | |  | k  r t Sq Wt S(   N(   R~   R#   t   absRP   RQ   (   R>   t   tR~   R$   R9   (    (    sl   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/reportlab/graphics/charts/axes.pyt   __contains__   s
    	c         C   sT   |  j  } x4 |  j D]) \ } } t | |  |  j  k  r | Sq Wt d |   d  S(   Ns   cannot locate index %r(   R~   R#   R   t
   IndexError(   R>   R   R~   R$   R9   (    (    sl   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/reportlab/graphics/charts/axes.pyt   __getitem__   s
    	(   Rf   Rg   Rh   R@   R   R   (    (    (    sl   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/reportlab/graphics/charts/axes.pyR}      s   		t   _AxisGc           B   s   e  Z d    Z d   Z d   Z d   Z d   Z d d  Z d g  i  d  Z	 d d g  d  Z
 d d g  d  Z d d d	  Z d
   Z e e  Z d   Z e e  Z d d  Z d   Z d   Z RS(   c         C   s+   |  j  |  } y | d } Wn n X| S(   Ni    (   t   scale(   R>   R9   (    (    sl   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/reportlab/graphics/charts/axes.pyRX      s    c         C   s0   |  j  |  } t | |  j | | |  j |  S(   N(   RX   R   RT   (   R>   R$   RC   RD   (    (    sl   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/reportlab/graphics/charts/axes.pyt   _cxLine   s    c         C   s0   |  j  |  } t |  j | | |  j | |  S(   N(   RX   R   RS   (   R>   Rn   RC   RD   (    (    sl   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/reportlab/graphics/charts/axes.pyt   _cyLine   s    c   	      C   s|   |  j  |  } |  j | } |  j | } t | |  t | |  } } | | } t | | | | | | | | g d d S(   Nt   strokeLineJoini   (   RX   RT   R3   R5   R   (	   R>   R$   RC   RD   t   _3d_dxt   _3d_dyt   y0t   y1t   x1(    (    sl   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/reportlab/graphics/charts/axes.pyt	   _cxLine3d  s    
c   	      C   s|   |  j  |  } |  j | } |  j | } t | |  t | |  } } | | } t | | | | | | | | g d d S(   NR   i   (   RX   RS   R3   R5   R   (	   R>   Rn   RC   RD   R   R   t   x0R   R   (    (    sl   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/reportlab/graphics/charts/axes.pyt	   _cyLine3d	  s    
c         C   s   t  | d d   } | d  k	 ra t  | d d   } |  j rB |  j pH |  j } | | | | | d  S|  j rs |  j py |  j } | | | d  Sd  S(   NR   R   c         S   s   | |  | | d | d | S(   NR   R   (    (   R9   Ra   R+   R,   R   R   (    (    sl   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/reportlab/graphics/charts/axes.pyR'     R(   c         S   s   | |  | |  S(   N(    (   R9   Ra   R+   R,   (    (    sl   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/reportlab/graphics/charts/axes.pyR'     R(   (   RU   R/   RR   R   R   R   R   (   R>   RC   RD   RK   R   R   R,   (    (    sl   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/reportlab/graphics/charts/axes.pyRY     s    c            s&  |  j  | | |
  } t |  d  s1 |  j   n    ra |  j rO   f d   p[   f d   } n d  } x |  j D] } | |  } | r | |  r qq n  | | _ | | _ | | _ | | _	 | | _
 |	 | _ | | k rx1 | | j   D] \ } } t | | |  q Wn  | j |  qq Wd  S(   NRL   c            s   |  j    k S(   N(   R   (   t   l(   t   exclude(    sl   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/reportlab/graphics/charts/axes.pyR'      R(   c            s   |  j    k S(   N(   R   (   R   (   R   (    sl   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/reportlab/graphics/charts/axes.pyR'      R(   (   RY   RV   RZ   RR   R/   RL   Rm   t   strokeWidtht   strokeDashArrayR   t   strokeLineCapt   strokeMiterLimitR[   R\   Rt   (   R>   t   gRC   RD   Rm   R   R   R   R   R   RK   R   t   specialsR&   t   exfR   Rd   t   aR9   (    (   R   sl   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/reportlab/graphics/charts/axes.pyt
   _makeLines  s(    * 						c   
      C   s  |  j  } |  j p d } | rg| rg|  j rg|  j } |  j } | d k sW | d k r | rx t | d  rx |   } n  | r | d k r | d } n  | d k r | d } q q | d k r d } n  | d k r d } q n  | s | rg|  j r|  j }	 n	 |  j	 }	 |  j
 | | |	 | |	 | | |  j |  j |  j |  j d | d | d t |  d i   	qgn  |  j | | | d g  d S(	   s)   this is only called by a container objecti    RG   i   RK   R   R   t   _gridSpecialsN(   t   gridStrokeColort   gridStrokeWidtht   visibleGridt	   gridStartt   gridEndR/   RV   RR   RS   RT   R   t   gridStrokeDashArrayt   gridStrokeLineJoint   gridStrokeLineCapt   gridStrokeMiterLimitRU   t   _makeSubGrid(
   R>   R   Rb   RK   R   R{   t   wRa   R+   R_   (    (    sl   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/reportlab/graphics/charts/axes.pyt   makeGrid1  s.    			   	 	 	]c         C   s  t  |  d d  o |  j d k s% d S|  j } |  j p: d } | oF | sM d S|  j } |  j } | d k sw | d k r | r t | d  r |   } n  | r | d k r | d } n  | d k r | d } q q | d k r d } n  | d k r d } q n  | s| r|  j r!|  j	 }	 n	 |  j
 }	 |  j   }
 zI |  j | | |	 | |	 | | |  j |  j |  j |  j d | d | 	Wd |
 |  _ Xn  d S(   s)   this is only called by a container objectt   visibleSubGridi    NRG   i   RK   R   (   RU   t
   subTickNumt   subGridStrokeColort   subGridStrokeWidtht   subGridStartt
   subGridEndR/   RV   RR   RS   RT   t   _calcSubTicksR   t   subGridStrokeDashArrayt   subGridStrokeLineJoint   subGridStrokeLineCapt   subGridStrokeMiterLimitRL   (   R>   R   Rb   RK   R   R{   R   Ra   R+   R_   t   otv(    (    sl   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/reportlab/graphics/charts/axes.pyR   G  s8    ! 	 		   	 	 	Ic         C   sN   | d  k r( |  j |  j f |  j } n  | d  k rD | |  j } n  | | f S(   N(   R/   RS   RT   RR   RW   (   R>   RC   RD   (    (    sl   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/reportlab/graphics/charts/axes.pyRF   a  s
      c         C   sF   t  |  d d   d k r t S|  j j } | d d k pE | d  d k S(   Nt
   _dataIndexi   i    t   Yi   t   AdjY(   RU   R/   RP   t	   __class__Rf   (   R>   t   acn(    (    sl   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/reportlab/graphics/charts/axes.pyRR   f  s     c         C   sF   t  |  d d   d k r t S|  j j } | d d k pE | d  d k S(   NR   i    t   Xi   t   NormalDateX(   RU   R/   RP   R   Rf   (   R>   R   (    (    sl   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/reportlab/graphics/charts/axes.pyt   isXAxisl  s     c         C   sG   | d  k r t |  d g   n  x! | D] } | j | |    q& Wd  S(   Nt   annotations(   R/   RU   Rt   (   R>   R   t   AR$   (    (    sl   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/reportlab/graphics/charts/axes.pyt   addAnnotationsr  s     c         C   s   t  |  d g   } i  } xq d D]i } g  j } g  j } x7 | D]/ } t  | | d
  rd | |  q? | |  q? W| j | | <| j | (q  W| d	 c | 7<| S(   NR   t   earlyt
   beforeAxist	   afterAxist   beforeTickst
   afterTickst   beforeTickLabelst   afterTickLabelst   latei    (   R   R   R   R   R   R   R   R   (   RU   t   appendt   __self__(   R>   R   t   DR9   t   Rt   PR   (    (    sl   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/reportlab/graphics/charts/axes.pyt   _splitAnnotationsw  s     
		c         C   s   t    } |  j   } |  j | | d  |  j r |  j | | d  | j |  j    |  j | | d  |  j | | d  | j |  j    |  j | | d  |  j | | d  | j |  j    |  j | | d  n  |  j | | d  | S(	   NR   R   R   R   R   R   R   R   (   R   R   R   t   visibleRt   t   makeAxist	   makeTickst   makeTickLabels(   R>   R   R   (    (    sl   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/reportlab/graphics/charts/axes.pyt   draw  s    		N(   Rf   Rg   RX   R   R   R   R   R/   RY   R   R   R   RF   RR   t   propertyR   R   R   R   (    (    (    sl   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/reportlab/graphics/charts/axes.pyR      s"   					
			t   CALabelc           B   s2   e  Z e d  e d e e d d  Z d   Z RS(   t   BASEt   labelPosFract   descs?   where in the category range [0,1] the labels should be anchoredc         K   s$   t  j |  |  |  j d d  d  S(   NR   g      ?(   R   R@   t   _setKeywords(   R>   t   kw(    (    sl   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/reportlab/graphics/charts/axes.pyR@     s    	(   Rf   Rg   t   AttrMapR   t   AttrMapValueR    t   _attrMapR@   (    (    (    sl   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/reportlab/graphics/charts/axes.pyR     s   t   CategoryAxisc        J   B   s  e  Z d  Z d Z e d e e d d d e e d d d e e d d d	 e e d d
 d e e d d d e e d d d e e d d d e e	 d d d e e
 d d d  d d d e e
 d d d  d d d e e d d d e e d d d e e d d d e e	 d d  d! e e
 d d d  d d" d# e e
 d d d  d d$ d% e e d d& d' e e d d( d) e e d d* d+ e e d d, d- e d[ d d. d/ e e d d0 d1 e d[ d d2 d3 e e d d4 d5 e e d d6 d7 e e
 d8 d9 d:  d;  d< e e
 d= d> d? d@  d dA dB e e d dC dD e e d dE dF e e d dG dH e d[ d dI dJ e e d dK dL e e d dM dN e e
 dO dP dQ dR  dS  dT e e d dU  #Z dV   Z dW   Z d[ dX  Z dY   Z dZ   Z RS(\   s+   Abstract category axis, unusable in itself.i   R   R   s   Display entire object, if true.t   visibleAxiss   Display axis line, if true.t   visibleTickss   Display axis ticks, if true.t   visibleLabelss   Display axis labels, if true.R   s   Display axis grid, if true.R   s   Width of axis line and ticks.Rm   s   Color of axis line and ticks.R   s   Dash array used for axis line.R   i    i   s#   Line cap 0=butt, 1=round & 2=squareR   s$   Line join 0=miter, 1=round & 2=bevelR   s$   miter limit control miter line joinsR   s   Width of grid lines.R   s   Color of grid lines.R   s   Dash array used for grid lines.R   s(   Grid Line cap 0=butt, 1=round & 2=squareR   s)   Grid Line join 0=miter, 1=round & 2=bevelR   s)   Grid miter limit control miter line joinsR   s#   Start of grid lines wrt axis originR   s!   End of grid lines wrt axis origint   drawGridLasts-   if true draw gridlines after everything else.t   labelss   Handle of the axis labels.t   categoryNamess   List of category names.RE   s   Join both axes if true.t   joinAxisPoss*   Position at which to join with other axis.t   reverseDirections#   If true reverse category direction.t   stylet   parallelt   stackedt   parallel_3ds$   How common category bars are plottedt   labelAxisModet   hight   lowR]   t   axispmvs*   Like joinAxisMode, but for the axis labelst	   tickShifts   Tick shift typicallyt   loPads*   extra inner space before start of the axist   hiPads'   extra inner space after end of the axisR   s   list of annotationst   loLLens*   extra line length before start of the axist   hiLLens'   extra line length after end of the axist   skipGridt   nonet   topt   botht   bottoms'   grid lines to skip top bottom both nonet   innerTickDraws#   Callable to replace _drawInnerTicksc         C   s  |  j  j d k s t d   d |  _ d |  _ d |  _ d |  _ d |  _ d |  _ d |  _	 d |  _
 d |  _ t |  _ d |  _ t d |  _ t d |  _ t d	 |  _ |  _ t d
 |  _ |  _ t d |  _ |  _ d |  _ t d |  _ t d |  _ d  |  _ |  _ t d	 |  _ t d
 |  _ t d |  _ t t  |  _  d  |  _! d  |  _" d  |  _# d  |  _$ d |  _% d |  _& d |  _' d  |  _( d |  _) d |  _* d |  _+ d |  _, d |  _- d  S(   NR   s(   Abstract Class CategoryAxis Instantiatedi2   id   i    i   Rm   R   R   R   R   g      ?R]   R   (.   R   Rf   t   AssertionErrorRS   RT   RW   t	   _catCountR   R   R   R   R   RQ   R   R   R   Rm   R   R   R   R   R   R   R   R   R   R   R/   R   R   R   R   R   R   RE   R   t   joinAxisModeR   R   R   t   _labelTextFormatR   R   R   R   R   (   R>   (    (    sl   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/reportlab/graphics/charts/axes.pyR@     sL    																								c         C   s1   t  |  |  _ t  |  |  _ t  |  |  _ d  S(   N(   t   floatRS   RT   RW   (   R>   R$   Rn   t   length(    (    sl   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/reportlab/graphics/charts/axes.pyt   setPosition  s    c         C   s   t  t t t |    |  _ | pK |  j |  j |  j t |  j pG d  |  _	 |  j
   |  j d k r g  t |  j  D]) } t g  | D] } | | ^ q  ^ qz |  _ n  d  S(   Ni   R   (   R5   R)   R*   R.   R   RW   R   R   R   t	   _barWidtht   _calcTickmarkPositionsR   t   xranget   sumt   _pmv(   R>   t   multiSeriest   barWidthRy   t   series(    (    sl   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/reportlab/graphics/charts/axes.pyt	   configure  s
    3
c         C   s|   |  j  } |  j r; g  t |  D] } | d ^ q |  _ n= |  j r_ t t d |   |  _ n t t | d   |  _ d  S(   Ng      ?ii   (   R   R   Rq   RL   R   R)   (   R>   t   nR   (    (    sl   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/reportlab/graphics/charts/axes.pyR    s    		)	c         C   s!   |  j  r |  j | d } n  | S(   Ni   (   R   R   (   R>   t   idx(    (    sl   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/reportlab/graphics/charts/axes.pyt   _scale  s    	 N(   Rf   Rg   Rh   t   _nodocR   R   R   R    R   R   R   R   R/   R   R   R   R@   R   R  R  R  (    (    (    sl   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/reportlab/graphics/charts/axes.pyR     sV   !	6		
c         C   s#   |  j  s t d |  j j   d  S(   Ns/   Cannot connect to other axes (%s), but Y- ones.(   RR   R   R   Rf   (   R]   (    (    sl   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/reportlab/graphics/charts/axes.pyt   _assertYAxis!  s    c         C   s#   |  j  s t d |  j j   d  S(   Ns/   Cannot connect to other axes (%s), but X- ones.(   R   R   R   Rf   (   R]   (    (    sl   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/reportlab/graphics/charts/axes.pyt   _assertXAxis#  s    t   _XTicksc           B   sJ   e  Z d  Z d   Z d d  Z d   Z d   Z d   Z d d  Z	 RS(   i    c      
   C   s   t  |  d d   } | r. | |  | | |  n | s: | r |  j } |  j } | r | rl | rl | | } q | r | r | | } q n  |  j | | | |  j | |  j |  j |  j |  j	 	 n  d  S(   NR   (
   RU   R/   R   t   _tickTweaksR   Rm   R   R   R   R   (   R>   t   tUt   tDR   t   itdt   sWt   tW(    (    sl   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/reportlab/graphics/charts/axes.pyt   _drawTicksInner)  s    		c         C   s2   | p t    } |  j r. |  j | | |  n  | S(   N(   R   R   R  (   R>   R  R  R   (    (    sl   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/reportlab/graphics/charts/axes.pyt
   _drawTicks7  s    	c         C   sn  t  |  d  s |  j   n  |  j } t  |  d  s^|  j j } | d  d k r_ d } t } n d } d   } g  | D] } t | d d	  ru | ^ qu } g  j } t |  j  } t	 |  }	 |	 d
 k  r g  |  _
 q^|	 d
 k r | d	 | d }
 nV |	 d k r,t | d	 | d | d
 | d	  }
 n  |	 d	 L}	 | |	 d	 | |	 }
 |
 | } |  j | } |  j | } | d | k r| j d | d |
  n  | d | k  r| j | d |
  n  |
 t | d	  :}
 xu t | d   D]c \ }	 } xT t |  D]F } | | | d	 |
  } | | k s| | k r=qn  | |  qWqW| j |  _
 n  |  j
 |  _ | S(   NRL   t   _subTickValuesi   R   i    g:0yE>c         S   s   |  S(   N(    (   R$   (    (    sl   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/reportlab/graphics/charts/axes.pyR'   H  R(   t   _doSubTicksi   i   i   i(   RV   RZ   RL   R   Rf   R7   RU   R   R   R.   R  R5   t	   _valueMint	   _valueMaxt   insertR   t	   enumerateRq   R   (   R>   R   R   t   iFuzzt   dCnvRu   t   OTVR#   t   nstRy   t   dstt   fuzzt   vnt   vxR$   t   jR   (    (    sl   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/reportlab/graphics/charts/axes.pyR   =  sN    			+	*

   c         C   sg   t  |  d d  rc |  j d k rc |  j   } z  d |  _ |  j | | |  Wd  |  ` | |  _ Xn  d  S(   Nt   visibleSubTicksi    i   (   RU   R   R   t   _subTickingR  RL   (   R>   R  R  R   R   (    (    sl   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/reportlab/graphics/charts/axes.pyt   _drawSubTicksg  s    !	c         C   s   |  j  } zi |  j t |  d d   |  _  |  j |  j |  j  } |  j t |  d d  t |  d d  |  | SWd  | |  _  Xd  S(   Nt   tickAxisModeR]   t	   subTickHii    t	   subTickLo(   RT   t   _labelAxisPosRU   R  t   tickUpt   tickDownR)  (   R>   t   yoldR   (    (    sl   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/reportlab/graphics/charts/axes.pyR   q  s    	+c         C   sU   |  j  } | rN | p |  j } | d k r1 | j S| d k rN | j | j Sn  |  j S(   NR   R   (   RE   R   RT   RW   (   R>   t   modeR]   (    (    sl   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/reportlab/graphics/charts/axes.pyR-  {  s    	N(
   Rf   Rg   R  R  R/   R  R   R)  R   R-  (    (    (    sl   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/reportlab/graphics/charts/axes.pyR  &  s   		*	
	
t   _YTicksc           B   s   e  Z d d   Z d   Z RS(   c         C   sU   |  j  } | rN | p |  j } | d k r1 | j S| d k rN | j | j Sn  |  j S(   NR   R   (   RE   R   RS   RW   (   R>   R1  R]   (    (    sl   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/reportlab/graphics/charts/axes.pyR-    s    	c         C   s   |  j  } zi |  j t |  d d   |  _  |  j |  j |  j  } |  j t |  d d  t |  d d  |  | SWd  | |  _  Xd  S(   NR*  R]   R+  i    R,  (   RS   R-  RU   R  t	   tickRightt   tickLeftR)  (   R>   t   xoldR   (    (    sl   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/reportlab/graphics/charts/axes.pyR     s    	+N(   Rf   Rg   R/   R-  R   (    (    (    sl   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/reportlab/graphics/charts/axes.pyR2    s   
t   XCategoryAxisc           B   s   e  Z d  Z e d e d e e d d d e e d d d e e d d	 d
 d d  d d  Z	 d Z
 d   Z d   Z d d d  Z d   Z d   Z d   Z d   Z RS(   s   X/category axisR   R.  R   s   Tick length up the axis.R/  s   Tick length down the axis.R   R   R   t   valuet   pointssI   Mode used for connecting axis ('bottom', 'top', 'value', 'points', None).i    c         C   s;   t  j |   d |  j _ d |  j _ d |  _ d |  _ d  S(   NR	  ii    i   (   R   R@   R   t	   boxAnchort   dyR.  R/  (   R>   (    (    sl   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/reportlab/graphics/charts/axes.pyR@     s
    	c         C   s   |  j  d d d  |  j d g  d d	 d
 d d g |  _ d |  j _ d |  j d _ d |  j d _ t d d  } | j |   | S(   Ni   iF   i   i
   i   i(   i2   t   Onet   Twot   Threet   Fourt   FiveR	  R+   i   iZ   i   id   (   i
   i   i   i(   i2   (   R   R  R   R   R9  t   angleR   Rt   (   R>   RM   (    (    sl   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/reportlab/graphics/charts/axes.pyt   demo  s    c         C   s   t  |  | d k r% | j |  _ n[ | d k rG | j | j |  _ n9 | d k rh | j |  |  _ n | d k r | |  _ n  d S(   s!   Join with y-axis using some mode.R   R   R7  R8  N(   R  RT   RW   R   (   R>   t   yAxisR1  t   pos(    (    sl   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/reportlab/graphics/charts/axes.pyt
   joinToAxis  s    
c         C   sl   |  j  } | rh |  j } | d k r: |  j | d | qh | d k rh |  j | d | d |  j qh n  d  S(	   NR   R   R1  R7  R8  RC  (   R   R   (   R7  R8  (   RE   R   RD  R   (   R>   t   jat   jam(    (    sl   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/reportlab/graphics/charts/axes.pyt   _joinToAxis  s    		c         C   s+   |  j  |  j |  j |  |  j |  j f S(   s>   returns the x position and width in drawing units of the slice(   RS   R   R  R   (   R>   R
  (    (    sl   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/reportlab/graphics/charts/axes.pyR     s    c         C   s   t    } |  j   |  j s  | St |  j |  j |  j |  j |  j |  j |  j  } |  j	 | _	 |  j
 | _
 |  j | _ | j |  | S(   N(   R   RG  R   R   RS   R   RT   RW   R   Rm   R   R   Rt   (   R>   R   R]   (    (    sl   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/reportlab/graphics/charts/axes.pyR     s    	
	 6c         C   s  t    } |  j s | S|  j } | d  k	 r|  j } t |  } |  j } |  j } |  j   } |  j	 } |  j
 d k r |  j n d  }	 xt |  D] }
 | r | |
 d } n |
 } | | k r q n  |
 | } | |  j k r |  j | } n |  j |
 } |	 r9| j } |	 | } | _ | d k  r?| d 9} q?n d } | j } | |
 | | } | j | | |  | j | | pd  | j |  q Wn  | S(   NR   i   i    iR(   (   R   R   R   R/   R   R.   R   R   R-  RS   R   R  Rq   R   R:  R   t	   setOrigint   setTextRt   (   R>   R   R   t   catCountR	  R   R  RT   RS   t   pmvRy   t   ict   labelt   _dyR9   t   lpfR$   (    (    sl   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/reportlab/graphics/charts/axes.pyR     sD    		 					  
	 	N(   Rf   Rg   Rh   R   R   R   R    R   R/   R   R   R@   RA  RD  RG  R   R   R   (    (    (    sl   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/reportlab/graphics/charts/axes.pyR6    s    											t   YCategoryAxisc           B   s   e  Z d  Z e d e d e e d d d e e d d d e e d  d d  Z	 d Z
 d   Z d   Z d d d  Z d   Z d   Z d   Z d   Z RS(   s   Y/category axisR   R4  R   s   Tick length left of the axis.R3  s   Tick length right of the axis.R   t   leftt   rightR7  R8  sI   Mode used for connecting axis ('left', 'right', 'value', 'points', None).i   c         C   s;   t  j |   d |  j _ d |  j _ d |  _ d |  _ d  S(   NR+   ii   i    (   R   R@   R   R9  t   dxR4  R3  (   R>   (    (    sl   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/reportlab/graphics/charts/axes.pyR@     s
    	c         C   s   |  j  d d d  |  j d g  d d d g |  _ d	 |  j _ d
 |  j d _ d |  j d _ t d d  } | j |   | S(   Ni2   i
   iP   i   i   R;  R<  R=  R+   Ra   i   iZ   i   id   (   i
   i   i   (   R   R  R   R   R9  R@  R   Rt   (   R>   RM   (    (    sl   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/reportlab/graphics/charts/axes.pyRA  #  s    c         C   s   t  |  | d k r) | j d |  _ ng | d k rO | j | j d |  _ nA | d k rt | j |  d |  _ n | d k r | d |  _ n  d S(   s!   Join with x-axis using some mode.RQ  g      ?RR  R7  R8  N(   R  RS   RW   R   (   R>   t   xAxisR1  RC  (    (    sl   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/reportlab/graphics/charts/axes.pyRD  0  s    
c         C   sl   |  j  } | rh |  j } | d k r: |  j | d | qh | d k rh |  j | d | d |  j qh n  d  S(	   NRQ  RR  R1  R7  R8  RC  (   RQ  RR  (   R7  R8  (   RE   R   RD  R   (   R>   RE  RF  (    (    sl   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/reportlab/graphics/charts/axes.pyRG  =  s    		c         C   s$   |  j  |  j |  |  j |  j f S(   s?   Returns the y position and width in drawing units of the slice.(   RT   R  R   (   R>   R
  (    (    sl   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/reportlab/graphics/charts/axes.pyR   F  s    c         C   s   t    } |  j   |  j s  | St |  j |  j |  j |  j |  j |  j |  j  } |  j	 | _	 |  j
 | _
 |  j | _ | j |  | S(   N(   R   RG  R   R   RS   RT   R   RW   R   Rm   R   R   Rt   (   R>   R   R]   (    (    sl   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/reportlab/graphics/charts/axes.pyR   J  s    	
	 6c         C   s  t    } |  j s | S|  j } | d  k	 r|  j } t |  } |  j } |  j } |  j } |  j	   } |  j
 }	 |  j d k r |  j n d  }
 xt |  D] } | r | | d } n | } | | k r q n  | | } | |  j k r |  j | } n |  j | } | j } |	 | | | } |
 r]| j } |
 | } | _ | d k  rc| d 9} qcn d } | j | | |  | j | | pd  | j |  q Wn  | S(   NR   i   i    iR(   (   R   R   R   R/   R   R.   R   R   R   R-  RT   R   R  Rq   R   RS  RH  RI  Rt   (   R>   R   R   RJ  R	  R   R  R   RS   RT   RK  Ry   RL  RM  RO  Rn   t   _dxR9   (    (    sl   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/reportlab/graphics/charts/axes.pyR   W  sF    		 						  
		 N(   RQ  RR  R7  R8  N(   Rf   Rg   Rh   R   R   R   R    R   R/   R   R   R@   RA  RD  RG  R   R   R   (    (    (    sl   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/reportlab/graphics/charts/axes.pyRP    s    											t   TickLabellerc           B   s   e  Z d  Z d   Z RS(   st   Abstract base class which may be used to indicate a change
    in the call signature for callable label formats
    c         C   s   d S(   Ns   Abstract class instance called(    (   R>   R]   R7  (    (    sl   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/reportlab/graphics/charts/axes.pyRG     s    (   Rf   Rg   Rh   RG   (    (    (    sl   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/reportlab/graphics/charts/axes.pyRV  }  s   t	   ValueAxisc           B   sP  e  Z d  Z e d e e e e d  f  d d d e e d d d e e d d d	 e e d d
 d e e d d d e e d d d e e d d d e e	 d d d e e
 d d d e e d d d  d d d e e d d d  d d d e e d d d e e d d d  e e	 d d! d" e e
 d d# d$ e e d d d  d d% d& e e d d d  d d' d( e e d d) d* e e d d+ d, e e d d- d. e e d d/ d0 e e d d1 d2 e e d d3 d4 e d d d5 d6 e e d7 d8 d9  d d: d; e d d d< d= e d d d> d? e e d d@ dA e e d dB dC e e d dD dE e e d dF dG e e
 d dH dI e e e e e dJ d dK d dL d f  d dM dN e e e e e dJ d dK d dL d f  d dO dP e e e e  e e dJ d dK d dL d f  d dQ dR e e dS dT dU dV  dW  dX e e d dY dZ e e d[ d\ d]  d^  d_ e e dS d` da dT  d db dc e e d dd de e e d df dg e e d dh di e e d7 d8 d9  d dj dk e e d dl dm e d d dn do e e d dp dq e e d dr ds e e d dt du e e d dv dw e e d dx dy e e d dz d{ e e d d| d} e e d d d~ e e	 d d! d e e
 d d# d e e d d d  d d% d e e d d d  d d' d e e d d) d e e d d+ d e e d d- d e e d d d e e dS d dT d  d  d e e d d d e e d d  @Z d   Z d   Z d   Z d   Z i  d  Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z  d   Z! d   Z" RS(   s(   Abstract value axis, unusable in itself.t	   forceZerot   nearR   s   Ensure zero in range if true.R   s   Display entire object, if true.R   s   Display axis line, if true.R   s   Display axis labels, if true.R   s   Display axis ticks, if true.R   s   Display axis grid, if true.R   s   Width of axis line and ticks.Rm   s   Color of axis line and ticks.R   s   Dash array used for axis line.R   i    i   i   s#   Line cap 0=butt, 1=round & 2=squareR   s$   Line join 0=miter, 1=round & 2=bevelR   s$   miter limit control miter line joinsR   s   Width of grid lines.R   s   Color of grid lines.R   s   Dash array used for grid lines.R   s(   Grid Line cap 0=butt, 1=round & 2=squareR   s)   Grid Line join 0=miter, 1=round & 2=bevelR   s)   Grid miter limit control miter line joinsR   s#   Start of grid lines wrt axis originR   s!   End of grid lines wrt axis originR   s-   if true draw gridlines after everything else.t   minimumTickSpacings)   Minimum value for distance between ticks.t   maximumTickss   Maximum number of ticks.R   s   Handle of the axis labels.R   R   R   R]   s*   Like joinAxisMode, but for the axis labelst   labelTextFormats3   Formatting string or function used for axis labels.t   labelTextPostFormats   Extra Formatting string.t   labelTextScales   Scaling for label tick values.t   valueMins   Minimum value on axis.t   valueMaxs   Maximum value on axis.t	   valueSteps   Step size used between ticks.t
   valueStepss&   List of step sizes used between ticks.t   avoidBoundFract   emptyOKRI   RH   s.   Fraction of interval to allow above and below.t   avoidBoundSpaces   Space to allow above and below.t   abf_ignore_zerosM   Set to True to make the avoidBoundFrac calculations treat zero as non-specialt
   rangeRoundR   R   t   ceilingt   floors   How to round the axis limitst
   zrangePrefs!   Zero range axis limit preference.R   t   normalR   R   s   How values are plotted!t   skipEndLRC   RD   s   Skip high/low tick labelst   origShiftIPCs"   Lowest label shift interval ratio.t   origShiftMins   Minimum amount to shift.t   origShiftSpecialValues   special value for shiftR*  s$   Like joinAxisMode, but for the ticksR   s#   If true reverse category direction.R   s   list of annotationsR   s*   extra line length before start of the axisR   s'   extra line length after end of the axisR   s   Number of axis sub ticks, if >0R,  s   sub tick down or leftR+  s   sub tick up or rightR'  s    Display axis sub ticks, if true.R   s   Display axis sub grid, if true.R   R   R   R   R   R   R   R   t   keepTickLabelsInsides?   Ensure tick labels do not project beyond bounds of axis if trueR   R   R   s'   grid lines to skip top bottom both nonet   requiredRanges   Minimum required value range.R   s#   Callable to replace _drawInnerTicksc         K   s  |  j  j d k s t d   |  j |   |  j d d d d d d d d	 d
 d d d d d d d d d d d d d d t d d t d d t d d t d d t d d d d t d d t d d t d d t d d t d d d  d d  d  t d! d d" d d# d d$ d d% d d& t d d' t d d( t d d) d d* t d d+ t d d, d  d- d  d. t t  d/ d d0 d1 d2 d3 d4 d  d5 d6 d7 d  d8 d  d9 d  d: d  d; d  d< d  d= d  d> d  d? t d@ dA dB d dC dD dE dA dF d  dG d  dH d  dI d6 dJ d dK d dL d dM d  Ad |  j	 _
 d  S(N   NRW  s%   Abstract Class ValueAxis Instantiatedt   _configuredi    RS   i2   RT   RW   id   R   i   R   R   R   R   RX  R   Rm   R   R   R   R   R   g      ?R   R   R   R   R   R   R   R   R   R'  R   R,  R+  R   R   R   R   R   R   R   R   R   Rp  RZ  i
   R[  i   R   R   R]   R\  R]  R^  R_  R`  Ra  Rc  Re  Rf  Rg  R   Rj  R   Rk  Rl  Rm  Rn  Ro  R*  R   R   R   Rq  (   R   Rf   R   R   R   R/   RQ   R   R   R   R@  (   R>   R   (    (    sl   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/reportlab/graphics/charts/axes.pyR@     s    	














c         C   s1   t  |  |  _ t  |  |  _ t  |  |  _ d  S(   N(   R   RS   RT   RW   (   R>   R$   Rn   R   (    (    sl   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/reportlab/graphics/charts/axes.pyR   "  s    c         C   s   |  j  |  |  j   d S(   s=  Let the axis configure its scale and range based on the data.

        Called after setPosition. Let it look at a list of lists of
        numbers determine the tick mark intervals.  If valueMin,
        valueMax and valueStep are configured then it
        will use them; if any of them are set to None it
        will look at the data and make some sensible decision.
        You may override this to build custom axes with
        irregular intervals.  It creates an internal
        variable self._values, which is a list of numbers
        to use in plotting.
        N(   t	   _setRanget   _configure_end(   R>   t
   dataSeries(    (    sl   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/reportlab/graphics/charts/axes.pyR  (  s    c         C   s!   |  j    |  j   d |  _ d  S(   Ni   (   R  t   _calcScaleFactorRr  (   R>   (    (    sl   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/reportlab/graphics/charts/axes.pyRt  8  s    

c         C   sg   y | | f } | | } WnF | |  _  | |  _ |  j   \ } } | | | d f } | | <n X| S(   Ng:0yE>(   R  R  t   _calcStepAndTickPositions(   R>   R_  R`  t   cachet   KR|   Ra  R#   (    (    sl   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/reportlab/graphics/charts/axes.pyt   _getValueStepAndTicks=  s    		c         C   s   |  j  } | d k r | | } | | k  r d | | } | d 9} t | | |  } t | | |  } | d k r | d k  r | d | } d } n+ | d k r | d k  r | | } d } n  | } |  _ | } |  _ q n  | | f S(   Ni    g      ?id   (   Rq  R3   R5   t
   _cValueMint
   _cValueMax(   R>   R_  R`  t   rrR|   t   mR   t   y2(    (    sl   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/reportlab/graphics/charts/axes.pyt   _preRangeAdjustH  s"    	

	
	c   '      C   s2  |  j  } } |  j } } | d k rE t | |  j d  } |  _ n  | d k rp t | |  j d  } |  _ n  | | k rJ| d k r| d k r | d k r t |  d d  } | d k r | } d } q| d k  r d } | } qd } d } qG|  j  d k rd } qGd } qJ| d k r7d | } d } qJd } d | } n  t |  d d  rt	 t | d d   } d	 } | | | }	 |	 |  _
 | |  _ | |  j |  _ |	 | d
  }
 | d k rt | |  j d d |
 } |  _ n  | d k rt | |  j d d |
 } |  _ qn  |  j | |  \ } } |  j } | } | } |  j } | r| d k rt t |  t |   d | | k } n  | r| d k  rd } q| d k rd } qqn  |  j } t |  d d  } | o| } t |  s| | f } n  t |  d t  } t |  s8| | f } n  | d k	 oG| } | rk| d k } | d k } n
 d } } |  j } | } | rt |  s| | f } qn  t	 |  j  } | p| p| } i  } d } xN| r%| d k r%| d 7} d } | s| rW|  j | | |  \ } } } | rI| | d } | | d } n
 d } } | r| | | }  t | | d |   } t | | d |   } n  | r| d }! n | }! | | }" | d st |!  | k r|! |" | k r|" } d } n  | r	| d }! n | }! | | }" | d s5t |!  | k rW|! |" | k rW|" } d } qWn  | r|  j | | |  \ } } } | r| | d | k  r| d | } d } q| | d | k } | d } n  | r"| | d | k r| d | } d } q| | d | k } | d } q"qqW| r?| r?| |  _ n	 d |  _ | |  _ | |  _ |  j }# |  j }$ |$ d k	 s|# d k	 r$|  j }% |  j   |  j |  j } } |% d k st |% |  d k  r$|# r|# |  j  }& n d }& |$ rt |& | | |$ |  j  }& n  |  j |& 8_ q$n  |  j!   d S(   s   Set minimum and maximum axis values.

        The dataSeries argument is assumed to be a list of data
        vectors. Each vector is itself a list or tuple of numbers.

        Returns a min, max tuple.
        i    Rj  g{Gz?g{Gzg333333?g        t   _bubblePloti   g      ?c         S   s[   y |  d } Wn t  k
 r+ t d } n X| | | d 9} | |  | | |  | |  S(   Ni   g?g      ?(   R   t	   bubbleMAx(   R#   R$   R&   t   bubbleVt	   bubbleMaxR9   (    (    sl   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/reportlab/graphics/charts/axes.pyR%     s    R%   RY  i   Rb  Rf  R   R   Ri  Rh  i
   i   igư>N(   R   Ri  (   R   Rh  ("   R_  R`  R/   R4   R   R{  R6   R|  RU   R   t   _bubbleVt
   _bubbleMaxRW   t   _bubbleRadiusR  Rg  RX  R3   R   Rc  R!   RQ   Re  Rz  R5   t   _computedValueStepR  R  Rm  Rn  Ro  t   _calcValueStept
   _valueStept   _rangeAdjust('   R>   Ru  t   oMinR_  t   oMaxR`  t   zrpR  t   fracR  R%   Rg  t   cMint   cMaxRX  t   abft   do_rrt   do_abft   abfizt   rrnt   rrxt   abSt   do_abst   aLt   goRx  t   iterRa  R#   R#  t   i0t   i1t   sfR9   t   uRm  Rn  Ro  R~  (    (    sl   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/reportlab/graphics/charts/axes.pyRs  \  s
   	  					
			 % (		, 	 	
	

 
,	 
,								
"!c         C   s&   |  j  |  _ |  j |  _ |  j   d  S(   N(   R_  R  R`  R  Rt  (   R>   (    (    sl   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/reportlab/graphics/charts/axes.pyRZ     s    c         C   s   d S(   s   Override this if you want to alter the calculated range.

        E.g. if want a minumamum range of 30% or don't want 100%
        as the first point.
        N(    (   R>   (    (    sl   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/reportlab/graphics/charts/axes.pyR    s    c         C   s   d S(   s   Override if you want to put slack at the ends of the axis
        eg if you don't want the last tick to be at the bottom etc
        N(    (   R>   (    (    sl   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/reportlab/graphics/charts/axes.pyt   _adjustAxisTicks  s    c         C   s'   |  j  t |  j |  j  |  _ |  j S(   s   Calculate the axis' scale factor.
        This should be called only *after* the axis' range is set.
        Returns a number.
        (   RW   R   R  R  t   _scaleFactor(   R>   (    (    sl   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/reportlab/graphics/charts/axes.pyRv    s     c   
      C   sb  t  |  d d   } | r* |  ` | |  _ n |  j   |  j } |  j } |  j } d | } |  j } t t	 |  |  } | | } | d k r | | | k r | d 8} q n | | | k  r | d 7} n  t t	 |  |  } | | } | d k r| | | k  r4| d 7} q4n | | | k r4| d 8} n  | g  t
 | | d  D] }	 |	 | ^ qKf S(	   NR  g:0yE>R   Ri  i   Rh  (   R   Ri  (   R   Rh  (   RU   R/   R  R  R  R  R  Rg  R7   R   Rq   (
   R>   Ra  R_  R`  R#  Rg  R  R9   R  Ry   (    (    sl   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/reportlab/graphics/charts/axes.pyRw    s2    
			
	
  
  c         C   s   |  j    d S(   Ni   (   Rw  (   R>   (    (    sl   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/reportlab/graphics/charts/axes.pyt   _calcTickPositions1  s    c         C   sE   t  |  d d  |  _ |  j r% |  j S|  j   |  _ |  j   |  j S(   sK   Calculate a list of tick positions on the axis.  Returns a list of numbers.Rb  N(   RU   R/   RL   R  R  (   R>   (    (    sl   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/reportlab/graphics/charts/axes.pyR  4  s    	 
c         C   sq   |  j  d k ra |  j |  j } | t t |  j d  t |  j  |  j  } t	 |  |  _
 n |  j  |  _
 d S(   s8   Calculate _valueStep for the axis or get from valueStep.i   N(   Ra  R/   R  R  R3   R   R[  RW   RZ  R   R  (   R>   t   rawRanget   rawInterval(    (    sl   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/reportlab/graphics/charts/axes.pyR  <  s
    0c         C   s   t  |  j  S(   N(   R:   RL   (   R>   (    (    sl   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/reportlab/graphics/charts/axes.pyt   _allIntTicksE  s    c         C   s  t    } |  j s | S|  j } | d  k rO |  j pI |  j   rF d pI t } nC | t k rp |  j   rp d } n" t | d  r | j |  j	  n  |  j
 } |  j } |  j |  j g } |  j } |  j   | d | <|  j } |  j d k rS|  j r |  j } n	 |  j } |  j d k r$| g } qY| | |  j g } |  j d k rY| d =qYn g  } t |  j	  }	 |	 d }
 xt |  j	  D]y\ } } | |	 } | | k r| | } n
 | | } | r| j r|  j |  } | rx1 | D]& } t | |  d k  rd  } PqqWn  | d  k	 r| d  k	 r8| | } n | } t | t  rZ| | } n t |  r| t |  k  r| | } qd	 } nO t | d
  rt | t  r| |  |  } q| |  } n t d |   | r| | } n  | | | <| j |   | j |  |  j rt |  t   r|  j } | s| j!   \ } } } } | | k  r| j" d | j# | |  } qn  | |
 k r| |  j } | j!   \ } } } } | | k r| j" d | j# | |  } qqqn  | j$ |  qqqW| S(   Ns   %.0ft
   calcPlacesi   R   RC   RD   i    gư>R(   RG   s   Invalid labelTextFormat %sRS  (%   R   R   R   R/   R\  R  t   strRV   R  RL   R]  R^  RS   RT   R   R-  R   Rl  R   RW   R.   R  R   R   R   Rr   R!   RV  t
   ValueErrorRH  RI  Rp  t
   XValueAxist	   getBoundst   cloneRS  Rt   (   R>   R   R,   t   postt   sclRC  RM   R   t   skt   ntickst   nticks1Ry   t   tickRM  R9   t   skvR   t   txtt   a_xR   R   R   R   t   a_x1(    (    sl   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/reportlab/graphics/charts/axes.pyR   H  s    		 	$ 							


 	 
		#)c         C   s   |  j  s t d   | d k r* d } n  |  j |  j f |  j } |  j } |  j rl | } | |  j 7} n  | | | |  j	 S(   sv   Converts a numeric value to a plotarea position.
        The chart first configures the axis, then asks it to
        s1   Axis cannot scale numbers before it is configuredi    N(
   Rr  R   R/   RS   RT   R   R  R   RW   R  (   R>   R7  t   orgR  (    (    sl   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/reportlab/graphics/charts/axes.pyR     s     			N(#   Rf   Rg   Rh   R   R   R
   R   R   R    R   R   R   R/   R   R   R   R   R@   R   R  Rt  Rz  R  Rs  RZ   R  R  Rv  Rw  R  R  R  R  R   R   (    (    (    sl   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/reportlab/graphics/charts/axes.pyRW    s   $66<!	W																VR  c           B   s   e  Z d  Z e d e d e e d d d e e d d d e d d d d	 e e d
 d d d d  d d d e e	 d d  Z
 d Z d   Z d   Z d
 d d  Z d   Z d   Z RS(   s   X/value axisR   R.  R   s   Tick length up the axis.R/  s   Tick length down the axis.RE   s   Join both axes if true.R   R   R   R7  R8  sI   Mode used for connecting axis ('bottom', 'top', 'value', 'points', None).R   s*   Position at which to join with other axis.i    c         K   se   t  j |  |  d |  j _ d |  j _ d |  j _ d |  _ d |  _ d  |  _	 d  |  _
 d  |  _ d  S(   NR	  i    ii   (   RW  R@   R   R9  RS  R:  R.  R/  R/   RE   R   R   (   R>   R   (    (    sl   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/reportlab/graphics/charts/axes.pyR@     s    				c         C   sC   |  j  d d d  |  j d	 g  t d d  } | j |   | S(
   Ni   i2   i   i
   i   i(   i   id   (   i
   i   i   i(   i2   (   R   R  R   Rt   (   R>   RM   (    (    sl   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/reportlab/graphics/charts/axes.pyRA    s
    c         C   s   t  |  | d k r) | j d |  _ ng | d k rO | j | j d |  _ nA | d k rt | j |  d |  _ n | d k r | d |  _ n  d S(   s!   Join with y-axis using some mode.R   g      ?R   R7  R8  N(   R  RT   RW   R   (   R>   RB  R1  RC  (    (    sl   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/reportlab/graphics/charts/axes.pyRD    s    
c         C   sr   |  j  } | rn |  j p d } | d k r@ |  j | d | qn | d k rn |  j | d | d |  j qn n  d  S(	   NR   R   R1  R7  R8  RC  (   R   R   (   R7  R8  (   RE   R   RD  R   (   R>   RE  RF  (    (    sl   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/reportlab/graphics/charts/axes.pyRG    s    	c         C   s   t    } |  j   |  j s  | St |  j |  j |  j |  j |  j |  j |  j  } |  j	 | _	 |  j
 | _
 |  j | _ | j |  | S(   N(   R   RG  R   R   RS   R   RT   RW   R   Rm   R   R   Rt   (   R>   R   R]   (    (    sl   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/reportlab/graphics/charts/axes.pyR     s    	
	 6N(   Rf   Rg   Rh   R   RW  R   R    R/   R   R   R   R   R@   RA  RD  RG  R   (    (    (    sl   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/reportlab/graphics/charts/axes.pyR    s$   												t   jant   febt   mart   aprt   mayt   junt   jult   augt   sept   octt   novt   deci   i   i   c         C   sd   |  j  d  \ } } t |  } | j   } t j |  d } | t | d k sZ t  | | f S(   s  This accepts and validates strings like "31-Dec" i.e. dates
    of no particular year.  29 Feb is allowed.  These can be used
    for recurring dates.  It returns a (dd, mm) pair where mm is the
    month integer.  If the text is not valid it raises an error.
    t   -i   (   t   splitR7   t   lowert   _monthst   indext   _maxDaysR   (   t   dmstrt   dstrt   mstrt   ddt   mm(    (    sl   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/reportlab/graphics/charts/axes.pyt   parseDayAndMonth  s    t   _isListOfDaysAndMonthsc           B   s    e  Z d  Z d   Z d   Z RS(   s   This accepts and validates lists of strings like "31-Dec" i.e. dates
    of no particular year.  29 Feb is allowed.  These can be used
    for recurring dates.
    c         C   sU   t  |  rM t } x4 | D], } y t |  \ } } Wq t } q Xq W| St Sd  S(   N(   R!   RP   R  RQ   (   R>   R$   t   answert   elementR  R  (    (    sl   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/reportlab/graphics/charts/axes.pyt   test  s    c         C   s   | S(   N(    (   R>   R$   (    (    sl   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/reportlab/graphics/charts/axes.pyt	   normalize#  s    (   Rf   Rg   Rh   R  R  (    (    (    sl   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/reportlab/graphics/charts/axes.pyR    s   	i   i   i   i   i   i   i<   ix   i   i   i,  ih  i  i  i  iX  i  iH  i  i8  i  i`	  t   NormalDateXValueAxisc            B   s  e  Z d  Z e d e d e e d d d e e d d d e e d d d	 e e d d
 d e e d d d d d e d. d d d e e
 e d d d d d d d d d e e
 e d d d d d d d d d e e d d d e e e
 e   d d d e e d d  d! e e d" d# d$ d%  d&   Z e j Z d'   Z d(   Z d)   Z d*   Z d+   Z d,   Z d-   Z RS(/   s   An X axis applying additional rules.

    Depending on the data and some built-in rules, the axis
    displays normalDate values as nicely formatted dates.

    The client chart should have NormalDate X values.
    R   t   bottomAxisLabelSlackR   s.   Fractional amount used to adjust label spacingt	   niceMonths$   Flag for displaying months 'nicely'.t   forceEndDates0   Flag for enforced displaying of last date value.t   forceFirstDates1   Flag for enforced displaying of first date value.t   forceDatesEachYears!   List of dates in format "31-Dec",sY   "1-Jan".  If present they will always be used for tick marks in the current year, rather s\   than the dates chosen by the automatic algorithm. Hyphen compulsory, case of month optional.t   xLabelFormats3   Label format string (e.g. '{mm}/{yy}') or function.t   dayOfWeekNameRd  i    RI   i   RH   s   Weekday names.t	   monthNamei   s   Month names.t	   dailyFreqsA   True if we are to assume daily data to be ticked at end of month.t   specifiedTickDatess/   Actual tick values to use; no calculations donet   specialTickClears@   clear rather than delete close ticks when forced first/end datesR   R   R   R   R   s'   grid lines to skip top bottom both nonec         K   s   t  j |  |  d |  _ d |  _ d |  _ d |  _ g  |  _ d |  _ d |  _ d d d d d	 d
 d g |  _	 d d d d d d d d d d d d g |  _
 d |  _ d  |  _ |  _ d  S(   Ng?i   i    s	   {mm}/{yy}t   Mondayt   Tuesdayt	   Wednesdayt   Thursdayt   Fridayt   Saturdayt   Sundayt   Januaryt   Februaryt   Marcht   Aprilt   Mayt   Junet   Julyt   Augustt	   Septembert   Octobert   Novembert   December(   R  R@   R  R  R  R  R  R  R  R  R  R  R/   Rb  R  (   R>   R   (    (    sl   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/reportlab/graphics/charts/axes.pyR@   F  s    								c         C   s   |  j    } | j |  | S(   s'   Convert a scalar to a NormalDate value.(   t   _valueClassR  (   R>   R$   RM   (    (    sl   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/reportlab/graphics/charts/axes.pyt
   _scalar2NDW  s    c         C   s   t  | t j  s$ |  j |  } n  t j t j } } z- |  j |  j t _ t _ | j |  j	  SWd | | t _ t _ Xd S(   s(   Create a formatted label for some value.N(
   Rr   R   t
   NormalDateR  t   _dayOfWeekNamet
   _monthNameR  R  t   formatMSR  (   R>   R9   RM   R~  (    (    sl   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/reportlab/graphics/charts/axes.pyt   _dateFormatter]  s    c   $         s    j  }   j } t | t  r3   f d   } n  | d } | d }   j } | j | j | j } } }	 | j | j	 | j
 }
 } } t | |  j d  | | |	 p d | |
 |  } t | d | d | d | d |  } | d | d } | d | d } t | | j   j  } | |   j } t |  } g  } g  }   j }   j r  j } g    j D] } | |  ^ qp} g  | D] } | |  ^ q}   j r| | d k r| t | d | d  | d | d | k r  j rd	 | d <q| d =| d =n    j r| | d k r| t | d | d  | d | d
 | k r  j rzd	 | d
 <q| d
 =| d
 =n  | | f S| | | | d  }   j rt t t   j   } | j   } | j   } g  } g  } | } x | | k r{xg | D]_ \ } } t j  | | | f  } | | k r| | k r| j! |  | j! | |   qqW| d 7} qW  j r| | d k r| j" d |  | j" d | |   | t | d | d  | d | d | k r  j rd	 | d <q| d =| d =qn    j r| | d k r| j! |  | j! | |   | t | d | d  | d | d
 | k r  j rd	 | d
 <q| d
 =| d
 =qn  | | f SxJt# D]B} | | }  |  | k r|  | | k r| d }!   j$ rW| j%   | d k r| pd }" |" rW  j rG| |!  d | d _& n  |! |" 8}! qWn  y  | j%   | d j%   k }# Wn d }# n Xx$ |! |# k r| |!  |! | 8}! qW  j r:| d | k r:| d  d | d _& | t | d | d  | d | d | k r:  j r&d	 | d <q7| d =| d =q:n    j r  j$ r|" r| t | d | d  | d | d
 | k r  j rd	 | d
 <q| d
 =| d
 =qn  y3 | d r| d | d k r| d =| d =n  Wn t' k
 rn X| | f SqWt( d   d S(   s   Complex stuff...

        Needs explanation...

        Yes please says Andy :-(.  Modified on 19 June 2006 to attempt to allow
        a mode where one can specify recurring days and months.
        c            s     j    |   S(   N(   R  (   R  (   R>   (    sl   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/reportlab/graphics/charts/axes.pyt	   formatters  s    i    is   
g333333?i   i   i   R(   ic         S   s2   | j  d | |   | j  d | | |    d  S(   Ni    (   R  (   Ry   t   xValsR  t   ticksR   (    (    sl   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/reportlab/graphics/charts/axes.pyt   addTick  s    i   s6   Problem selecting NormalDate value axis tick positionsN()   RW   R  Rr   RV  R   t   fontNamet   fontSizet   leadingt
   textAnchorR9  R@  R   R  R   R5   Ro   RZ  R  R.   R[  R  R  R  R   R  R  R  R)   R*   R  t   yearR   t   NDR   R  t   _NDINTMR  t   monthR  R   R  ($   R>   R  t
   axisLengthR  t	   firstDatet   endDateR   R  R   R  R  R9  R@  t   RBLt   xLabelWt   xLabelHR   t   WR	  R  R[  t   VCR$   RM   R  t   forcedPartialDatest	   firstYeart   lastYeart   yyyyR  R  t   theDateRe   Ry   R&  t   wfd(    (   R>   sl   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/reportlab/graphics/charts/axes.pyt   _xAxisTickerh  s    		

	(			"K	K	
	2	2	


	"	
 


2	2	c         C   ss   |  j  } xc | D][ } xR t t |   D]> } | | \ } } t | |  s) | |  | f | | <q) q) Wq Wd S(   s1   Convert all XValues to a standard normalDate typeN(   R  Rq   R.   Rr   (   R>   t   dataR  R   Ry   R$   Rn   (    (    sl   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/reportlab/graphics/charts/axes.pyt
   _convertXV  s    	c   	      C   s   |  j  r g  } d } | d } xK | D]C } | j   } | | k rc | rZ | j |  n  | } n  | } q& W| d } | d | k r | j |  n  |  j |  \ } } n |  j |  \ } } | | f S(   Ni    i(   R  R  R   R  (	   R>   R  t   xEOMt   pmt   pxR$   R~  t   stepsR   (    (    sl   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/reportlab/graphics/charts/axes.pyt   _getStepsAndLabels  s"    	
 	

 c   	      C   s  |  j  |  t   } x0 | D]( } x | D] } | j | d  q* Wq Wt |  } | j   |  j |  \ } } |  j |  j } } | d  k r | d } n  | d  k r | d } n  | | |  _	 |  _
 | |  _ | |  _ |  j t | |  |  _ | |  _ d |  _ d  S(   Ni    ii   (   R  t   setRt   R)   t   sortR  R_  R`  R/   R  R  RL   R   RW   R   R  Rr  (	   R>   R  R  R$   t   dvR  R   R_  R`  (    (    sl   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/reportlab/graphics/charts/axes.pyR    s&    	
  			N(   Rf   Rg   Rh   R   R  R   R    R   t   isListOfDaysAndMonthsR/   R   R	   R   R   R   R   R   R  R  R@   R  R  R  R  R  R  (    (    (    sl   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/reportlab/graphics/charts/axes.pyR  *  s0   	
**!						
	t
   YValueAxisc           B   s   e  Z d  Z e d e d e e d d d e e d d d e d d d d	 e e d  d d d e e	 d d  Z
 d Z d   Z d   Z d
 d d  Z d   Z d   Z RS(   s   Y/value axisR   R4  R   s   Tick length left of the axis.R3  s   Tick length right of the axis.RE   s   Join both axes if true.R   RQ  RR  R7  R8  sI   Mode used for connecting axis ('left', 'right', 'value', 'points', None).R   s*   Position at which to join with other axis.i   c         C   sb   t  j |   d |  j _ d |  j _ d |  j _ d |  _ d |  _ d  |  _	 d  |  _
 d  |  _ d  S(   NR+   ii    i   (   RW  R@   R   R9  RS  R:  R3  R4  R/   RE   R   R   (   R>   (    (    sl   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/reportlab/graphics/charts/axes.pyR@   8  s    				c         C   sI   d g } |  j  d d d  |  j |  t d d  } | j |   | S(	   Ni
   i   i   i*   id   iP   i   (   i
   i   i   i*   (   R   R  R   Rt   (   R>   R  t   drawing(    (    sl   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/reportlab/graphics/charts/axes.pyRA  F  s    	c         C   s   t  |  | d k r) | j d |  _ ng | d k rO | j | j d |  _ nA | d k rt | j |  d |  _ n | d k r | d |  _ n  d S(   s!   Join with x-axis using some mode.RQ  g      ?RR  R7  R8  N(   R  RS   RW   R   (   R>   RT  R1  RC  (    (    sl   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/reportlab/graphics/charts/axes.pyRD  O  s    
c         C   sl   |  j  } | rh |  j } | d k r: |  j | d | qh | d k rh |  j | d | d |  j qh n  d  S(	   NRQ  RR  R1  R7  R8  RC  (   RQ  RR  (   R7  R8  (   RE   R   RD  R   (   R>   RE  RF  (    (    sl   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/reportlab/graphics/charts/axes.pyRG  [  s    		c         C   s   t    } |  j   |  j s  | St |  j |  j |  j |  j |  j |  j |  j  } |  j	 | _	 |  j
 | _
 |  j | _ | j |  | S(   N(   R   RG  R   R   RS   RT   R   RW   R   Rm   R   R   Rt   (   R>   R   R]   (    (    sl   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/reportlab/graphics/charts/axes.pyR   d  s    	
	 6N(   RQ  RR  R7  R8  N(   Rf   Rg   Rh   R   RW  R   R    R/   R   R   R   R   R@   RA  RD  RG  R   (    (    (    sl   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/reportlab/graphics/charts/axes.pyR!  %  s$   													t   AdjYValueAxisc           B   s   e  Z d  Z e d e d e e d d d e e d d d e e d d d	 e e e e	 f  d d
 d e e d d  Z
 d   Z d   Z RS(   s   A Y-axis applying additional rules.

    Depending on the data and some built-in rules, the axis
    may choose to adjust its range and origin.
    R   t   leftAxisPercentR   s+   When true add percent sign to label values.t   leftAxisOrigShiftIPCs"   Lowest label shift interval ratio.t   leftAxisOrigShiftMins   Minimum amount to shift.t   leftAxisSkipLL0s8   Skip/Keep lowest tick label when true/false.
Or skiplistt   labelVOffsets   add this to the labelsc         K   sQ   t  j |  |  d |  _ d |  _ d |  _ d |  _ d |  _ |  _ d  |  _	 d  S(   Ni   i   g333333?i   i    (
   R!  R@   Rq  R$  R%  R&  R'  R(  R/   Rb  (   R>   R   (    (    sl   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/reportlab/graphics/charts/axes.pyR@   ~  s    				c         C   s  d d l  m } m } |  j |  j } } |  j } t t | d  d d d d d d	 g   } | sq | g } n  |  j |  j	 } } | r~| | | k  r~| | | d
 | d | d  \ }	 }
 |
 |	 | k  rh|	 |
 d } t
 | | d |  }	 t | | d |  }
 | d k r:|	 d k  r:|
 d |	 }
 d }	 qh| d k rh|	 d k  rh|
 |	 }
 d }	 qhn  |	 |
 |  _ |  _ n  | |  j |  j d d d
 | d |  j d | d |  j \ } } |  j } | r| d | d } t |  s| | } } n | | d } | | d } t |  d | d  } t |  d | d  } | | d | k  rj|  j | |  _ n  | d | | k  r|  j | |  _ n  | |  j |  j d d d
 | d |  j d | d |  j \ } } n  | d |  _ | d |  _ | |  _ |  j d k r| |  _ n |  j |  _ t |  j d  d k  r|  j   |  j |  j } } t |  j |  j | | |  j |  j  } |  j | |  _ n  |  j rt |  j  rx6 |  j D]( } y d | | <Wqt k
 rqXqWn  d | d <n  d S(   s$   Adjusts the value range of the axis.i(   t   find_good_gridR  c         S   s
   |  | k S(   N(    (   R$   R~  (    (    sl   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/reportlab/graphics/charts/axes.pyR'     R(   i   i   i   i   i   i	   R	  t   gridi   g      ?id   i    R  i   t   percentR(  R{  R|  gư>R(   N(   t   reportlab.graphics.charts.utilsR)  R  R  R  R[  R)   R-   Ra  Rq  R3   R5   R$  R(  Rc  R!   RU   RL   R\  R/   R   R   R  R%  R  R&  RW   R'  R   (   R>   R)  R  t   y_mint   y_maxR~  R	  Ra  Rq  R   R  t   ymR#   Rd   R  R  R  t   _nRS   t   vMaxt   vMinR$   (    (    sl   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/reportlab/graphics/charts/axes.pyR    sn    	- %	
?	  B	
	(   Rf   Rg   Rh   R   R!  R   R   R    R
   R   R   R@   R  (    (    (    sl   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/reportlab/graphics/charts/axes.pyR#  p  s   		c          C   sm   t  d d  }  d
 g } t   } | j d d d  | j |  d d g | _ d	 | j _ |  j |  |  S(   s2   Sample drawing with one xcat axis and two buckets.i  i   i
   i   iK   i,  t   Yingt   YangR	  (   i
   i   (   R   R6  R   R  R   R   R9  Rt   (   R"  R  RT  (    (    sl   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/reportlab/graphics/charts/axes.pyt   sample0a  s    		c          C   sj   t  d d  }  d g } t   } | j d d d  | j |  d g | _ d | j _ |  j |  |  S(	   s6   Sample drawing with one xcat axis and one bucket only.i  i   i
   iK   i,  R3  R	  (   i
   (   R   R6  R   R  R   R   R9  Rt   (   R"  R  RT  (    (    sl   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/reportlab/graphics/charts/axes.pyt   sample0b  s    		c          C   s   d d l  m }  t d d  } d g } t   } | j d	 d	 d
  | j |  d d d d g | _ d | j _ d | j d _	 d | j d _
 |  | j d _ t   } | j d d d  | j |  | j |  | j |  | S(   s/   Sample drawing containing two unconnected axes.i(   t   _baseGFontNameBi  i   i
   i   i   i*   iK   i,  t   Beert   Winet   Meatt
   CannelloniR	  ii   i2   i}   (   i
   i   i   i*   (   t   reportlab.graphics.shapesR7  R   R6  R   R  R   R   R9  R:  R@  R  R!  Rt   (   R7  R"  R  RT  RB  (    (    sl   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/reportlab/graphics/charts/axes.pyt   sample1  s"    			c          C   s   t  d d  }  d g } t   } | j d d d  | j |  t   } d	 | _ | | _ d
 | _ d | _ | j |  |  j	 |  |  j	 |  |  S(   s@   Sample drawing, xvalue/yvalue axes, y connected at 100 pts to x.i  i   i
   i   i   i*   i2   i}   i,  R8  id   (   i
   i   i   i*   (
   R   R!  R   R  R  RW   RE   R   R   Rt   (   R"  R  RB  RT  (    (    sl   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/reportlab/graphics/charts/axes.pyt   sample4a  s    							c          C   s   t  d d  }  d g } t   } | j d d d  | j |  t   } d	 | _ | | _ d
 | _ d | _ | j |  |  j	 |  |  j	 |  |  S(   sA   Sample drawing, xvalue/yvalue axes, y connected at value 35 of x.i  i   i
   i   i   i*   i2   i}   i,  R7  i#   (   i
   i   i   i*   (
   R   R!  R   R  R  RW   RE   R   R   Rt   (   R"  R  RB  RT  (    (    sl   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/reportlab/graphics/charts/axes.pyt   sample4b
  s    							c          C   s   t  d d  }  d g } t   } | j d d d  | j |  t   } d	 | _ | | _ d
 | _ | j |  |  j |  |  j |  |  S(   s?   Sample drawing, xvalue/yvalue axes, y connected to bottom of x.i  i   i
   i   i   i*   i2   i}   i,  R   (   i
   i   i   i*   (	   R   R!  R   R  R  RW   RE   R   Rt   (   R"  R  RB  RT  (    (    sl   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/reportlab/graphics/charts/axes.pyt   sample4c  s    						c          C   s   t  d d  }  d g } t   } | j d d d  | j |  d	 | _ d	 | _ t   } d
 | _ | | _ d | _	 | j |  d	 | _ d	 | _ |  j
 |  |  j
 |  |  S(   s5   xvalue/yvalue axes, without drawing axis lines/ticks.i  i   i
   i   i   i*   i2   i}   i    i,  R   (   i
   i   i   i*   (   R   R!  R   R  R   R   R  RW   RE   R   Rt   (   R"  R  RB  RT  (    (    sl   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/reportlab/graphics/charts/axes.pyt	   sample4c1+  s"    										c          C   s   t  d d  }  d g } t   } | j d d d  | j |  t   } d	 | _ | | _ d
 | _ | j |  |  j |  |  j |  |  S(   s<   Sample drawing, xvalue/yvalue axes, y connected to top of x.i  i   i
   i   i   i*   i2   i}   i,  R   (   i
   i   i   i*   (	   R   R!  R   R  R  RW   RE   R   Rt   (   R"  R  RB  RT  (    (    sl   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/reportlab/graphics/charts/axes.pyt   sample4d?  s    						c          C   s   t  d d  }  d g } t   } | j d d d  | j |  t   } | j d d d	  | | _ d
 | _ d | _ | j |  |  j |  |  j |  |  S(   s@   Sample drawing, xvalue/yvalue axes, y connected at 100 pts to x.i  i   i
   i   i   i*   i2   i,  i}   R8  id   (   i
   i   i   i*   (	   R   R  R   R  R!  RE   R   R   Rt   (   R"  R  RT  RB  (    (    sl   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/reportlab/graphics/charts/axes.pyt   sample5aO  s    						c          C   s   t  d d  }  d g } t   } | j d d d  | j |  t   } | j d d d	  | | _ d
 | _ d | _ | j |  |  j |  |  j |  |  S(   sA   Sample drawing, xvalue/yvalue axes, y connected at value 35 of x.i  i   i
   i   i   i*   i2   i,  i}   R7  i#   (   i
   i   i   i*   (	   R   R  R   R  R!  RE   R   R   Rt   (   R"  R  RT  RB  (    (    sl   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/reportlab/graphics/charts/axes.pyt   sample5b`  s    						c          C   s   t  d d  }  d g } t   } | j d d d  | j |  t   } | j d d d	  | | _ d
 | _ | j |  |  j |  |  j |  |  S(   s>   Sample drawing, xvalue/yvalue axes, y connected at right of x.i  i   i
   i   i   i*   i2   i,  i}   RR  (   i
   i   i   i*   (   R   R  R   R  R!  RE   R   Rt   (   R"  R  RT  RB  (    (    sl   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/reportlab/graphics/charts/axes.pyt   sample5cq  s    					c          C   s   t  d d  }  d g } t   } | j d d d  | j |  t   } | j d d d	  | | _ d
 | _ | j |  |  j |  |  j |  |  S(   s=   Sample drawing, xvalue/yvalue axes, y connected at left of x.i  i   i
   i   i   i*   i2   i,  i}   RQ  (   i
   i   i   i*   (   R   R  R   R  R!  RE   R   Rt   (   R"  R  RT  RB  (    (    sl   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/reportlab/graphics/charts/axes.pyt   sample5d  s    					c          C   s   t  d d  }  d g } t   } | j d d d  | j |  t   } d	 | _ | j |  | | _ d
 | _ d d d d g | _ d | j	 _
 |  j |  |  j |  |  S(   s:   Sample drawing, xcat/yvalue axes, x connected at top of y.i  i   i
   i   i   i*   i2   i}   i,  R   R8  R9  R:  R;  R	  (   i
   i   i   i*   (   R   R!  R   R  R6  RW   RE   R   R   R   R9  Rt   (   R"  R  RB  RT  (    (    sl   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/reportlab/graphics/charts/axes.pyt   sample6a  s    						c          C   s   t  d d  }  d g } t   } | j d d d  | j |  t   } d	 | _ | j |  | | _ d
 | _ d d d d g | _ d | j	 _
 |  j |  |  j |  |  S(   s=   Sample drawing, xcat/yvalue axes, x connected at bottom of y.i  i   i
   i   i   i*   i2   i}   i,  R   R8  R9  R:  R;  R	  (   i
   i   i   i*   (   R   R!  R   R  R6  RW   RE   R   R   R   R9  Rt   (   R"  R  RB  RT  (    (    sl   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/reportlab/graphics/charts/axes.pyt   sample6b  s    						c          C   s   t  d d  }  d g } t   } | j d d d  | j |  t   } d	 | _ | j |  | | _ d
 | _ d | _ d d d d g | _	 d | j
 _ |  j |  |  j |  |  S(   s>   Sample drawing, xcat/yvalue axes, x connected at 100 pts to y.i  i   i
   i   i   i*   i2   i}   i,  R8  id   R8  R9  R:  R;  R	  (   i
   i   i   i*   (   R   R!  R   R  R6  RW   RE   R   R   R   R   R9  Rt   (   R"  R  RB  RT  (    (    sl   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/reportlab/graphics/charts/axes.pyt   sample6c  s     							c          C   s   t  d d  }  d g } t   } | j d d d  | j |  t   } d	 | _ | j |  | | _ d
 | _ d | _ d d d d g | _	 d | j
 _ |  j |  |  j |  |  S(   s?   Sample drawing, xcat/yvalue axes, x connected at value 20 of y.i  i   i
   i   i   i*   i2   i}   i,  R7  R8  R9  R:  R;  R	  (   i
   i   i   i*   (   R   R!  R   R  R6  RW   RE   R   R   R   R   R9  Rt   (   R"  R  RB  RT  (    (    sl   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/reportlab/graphics/charts/axes.pyt   sample6d  s     							c          C   s   t  d d  }  d g } t   } d | _ | j |  t   } | j d d d	  | | _ d
 | _ d d d d g | _ d | j	 _
 | j |  |  j |  |  j |  |  S(   s<   Sample drawing, xvalue/ycat axes, y connected at right of x.i  i   i
   i   i   i*   i,  i2   i}   RR  R8  R9  R:  R;  R+   (   i
   i   i   i*   (   R   R  RW   R  RP  R   RE   R   R   R   R9  Rt   (   R"  R  RT  RB  (    (    sl   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/reportlab/graphics/charts/axes.pyt   sample7a  s    						c          C   s   t  d d  }  d g } t   } d | _ | j |  t   } | j d d d	  | | _ d
 | _ d d d d g | _ d | j	 _
 | j |  |  j |  |  j |  |  S(   s;   Sample drawing, xvalue/ycat axes, y connected at left of x.i  i   i
   i   i   i*   i,  i2   i}   RQ  R8  R9  R:  R;  R+   (   i
   i   i   i*   (   R   R  RW   R  RP  R   RE   R   R   R   R9  Rt   (   R"  R  RT  RB  (    (    sl   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/reportlab/graphics/charts/axes.pyt   sample7b  s    						c          C   s   t  d d  }  d g } t   } d | _ | j |  t   } | j d d d	  | | _ d
 | _ d | _ d d d d g | _	 d | j
 _ | j |  |  j |  |  j |  |  S(   s?   Sample drawing, xvalue/ycat axes, y connected at value 30 of x.i  i   i
   i   i   i*   i,  i2   i}   R7  R8  R9  R:  R;  R+   (   i
   i   i   i*   (   R   R  RW   R  RP  R   RE   R   R   R   R   R9  Rt   (   R"  R  RT  RB  (    (    sl   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/reportlab/graphics/charts/axes.pyt   sample7c  s     							c          C   s   t  d d  }  d g } t   } d | _ | j |  t   } | j d d d	  | | _ d
 | _ d | _ d d d d g | _	 d | j
 _ | j |  |  j |  |  j |  |  S(   s>   Sample drawing, xvalue/ycat axes, y connected at 200 pts to x.i  i   i
   i   i   i*   i,  i2   i}   R8  R8  R9  R:  R;  R+   (   i
   i   i   i*   (   R   R  RW   R  RP  R   RE   R   R   R   R   R9  Rt   (   R"  R  RT  RB  (    (    sl   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/reportlab/graphics/charts/axes.pyt   sample7d	  s     							(b   t   __version__Rh   t   reportlab.lib.validatorsR    R   R   R   R   R   R   R   R   R	   R
   R   R   R   R   R   t   reportlab.lib.attrmapt   reportlab.libR   R<  R   R   R   R   R   R   R   R   t   reportlab.graphics.widgetbaseR   R   t$   reportlab.graphics.charts.textlabelsR   R   R,  R   t    reportlab.graphics.widgets.gridsR   t   reportlab.lib.colorsR    t   reportlab.lib.utilsR!   RN   R"   t	   NameErrort	   functoolsR/   R2   R4   R6   R:   R;   Ri   R}   R   R   R   R  R  R  R2  R6  RP  RV  RW  R  R  R  R  R  R   R  R  R!  R#  R5  R6  R=  R>  R?  R@  RA  RB  RC  RD  RE  RF  RG  RH  RI  RJ  RK  RL  RM  RN  (    (    (    sl   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/reportlab/graphics/charts/axes.pyt   <module>   s   j
:		GEz		_qq  *U**		HKW																			