ÿþ 
 / * = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =  
  
   X Y G r a p h . j s   :   v 2 . 3  
  
   b y   J .   G e b e l e i n ,   L a s t   U p d a t e d   2 0 0 6 . 0 1 . 1 1  
  
   C o n t a c t :   i n f o @ S t r u c t u r a . i n f o  
  
   A l l   r i g h t s   r e s e r v e d .   C o p y r i g h t   2 0 0 6   S t r u c t u r a . i n f o  
  
  
   T h i s   s c r i p t   g e n e r a t e s   a n   X Y   G r a p h   u s i n g   V e c t o r   M a r k u p   L a n g u a g e   ( V M L )   a n d   r e t u r n s  
   a n   h t m l   s t r i n g   f o r   d i s p l a y   v i a   J a v a s c r i p t .     L a b e l s   f o r   p o i n t s   o n   a   l i n e ,   i n d i v i d u a l  
   l a b e l s   a n d   a r r o w s   m a y   b e   d r a w n   w i t h   f u l l y   c u s t o m i z a b l e   f e a t u r e s .     M u l t i p l e   l i n e s    
   w i t h   u n l i m i t e d   p o i n t s   a n d   c u s t o m i z a b l e   f o r m a t s   c a n   b e   d r a w n   o n   t h e   s a m e   p l o t   w i t h    
   i n t e l l i g e n t   d a t a   a x e s   t h a t   p r o v i d e   a   b e s t   f i t   t o   t h e   d a t a   f o r   s i m p l e ,   d y n a m i c    
   p r o g r a m m i n g .      
  
   T h e   V M L   u s e d   b y   t h i s   s c r i p t   i s   f u l l y   s u p p o r t e d   b y   I n t e r n e t   E x p l o r e r   5   o r   l a t e r ,    
   a n d   w i l l   r u n   o n   a n y   w e b s i t e   o r   i n t r a n e t ,   o n l i n e   o r   o f f l i n e .     D a t a   f o r   t h e   g r a p h  
   m a y   b e   g e n e r a t e d   f r o m   s t a t i c   o r   d y n a m i c   J a v a s c r i p t   a n d   u s e r   f o r m   i n t e r f a c e s ,   o r  
   e v e n   f r o m   c o m p l e x   a c t i v e   s e r v e r   d a t a b a s e   p r o g r a m s .  
  
   U s e   o f   t h i s   c o d e   i s   f r e e   f o r   a l l   n o n - c o m m e r c i a l   w e b s i t e s .     I f   y o u   f i n d   t h i s   c o d e  
   t o   b e   u s e f u l ,   I   w i l l   g l a d l y   a c c e p t   P a y P a l   d o n a t i o n s   t o   i n f o @ S t r u c t u r a . i n f o .   I    
   p r o v i d e   f r e e   e m a i l   s u p p o r t   a n d   w i l l   t r y   t o   a c c o m o d a t e   y o u r   v a r i o u s   n e e d s   i n t o  
   i m p r o v i n g   t h i s   p r o g r a m .  
  
   F o r   c o m m e r c i a l   u s e   I   a s k   f o r   a   o n e   t i m e   l i c e n s i n g   f e e   o f   $ 3 9 . 9 5   p e r   d o m a i n ,   o r    
   $ 9 9 . 9 5   f o r   a n   u n l i m i t e d   l i c e n s e .   B o t h   w i l l   c o v e r   a l l   f u t u r e   v e r s i o n   u p g r a d e s   a n d    
   a l l o w   f o r   c u s t o m i z a t i o n   o f   t h e   s o u r c e   c o d e .   A n   u n l i m i t e d   l i c e n s e   w i l l   a l l o w  
   u n r e s t r i c t e d   u s e   b y   a   s i n g l e   o r g a n i z a t i o n   i n c l u d i n g   r e d i s t r i b u t i o n   o r   r e s a l e   a s    
   s u p p o r t i n g   c o d e   f o r   a   s o f t w a r e   p r o d u c t .  
  
   P l e a s e   l e a v e   t h i s   h e a d e r   i n t a c t   i f   y o u   i n t e n d   o n   s h a r i n g   t h i s   c o d e .  
  
 = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =  
  
 " X Y G r a p h "   o b j e c t   d o c u m e n t a t i o n  
  
 I n i t i a l i z e :    
 	 v a r   M y G r a p h   =   n e w   X Y G r a p h ( ) ;  
 	 M y G r a p h . x m a x   =   1 0 ;   / /   s e t   p r o p e r t i e s   a s   d e s i r e d  
 	 	  
 P r o p e r t i e s :    
 	 S e e   c o n s t r u c t o r   s c r i p t   w i t h   i n l i n e   c o m m e n t s   b e l o w .  
 	  
 M e t h o d s :  
 	 M y G r a p h . P l o t ( X Y L i n e   [ ,   X Y L i n e _ 1 ,   . . . ] )   / /   r e t u r n s   h t m l   c o d e   f o r   d i s p l a y  
  
 N o t e s :  
  
   I n p u t   x , y   c o o r d i n a t e   p a i r s   u s i n g   t h e   " X Y L i n e "   o b j e c t   f o u n d   i n   t h i s   s c r i p t .  
  
   T h e   o n l y   r e q u i r e d   i n p u t   i s   t h e   x   a n d   y   d a t a ,   a l l   f o r m a t t i n g   a n d   o t h e r  
   p a r a m e t e r s   e i t h e r   h a v e   d e f a u l t   v a l u e s   d e f i n e d   i n   t h i s   s c r i p t ,   o r   a r e  
   a u t o m a t i c a l l y   c a l c u l a t e d   a s   r e q u i r e d   t o   b e s t   d i s p l a y   t h e   d a t a .  
  
   M u l t i p l e   X Y L i n e   o b j e c t s   m a y   b e   p a s s e d   t o   t h e   P l o t   f u n c t i o n   f o r   g r a p h i n g .  
  
   E x t r e m e   v a l u e s   + / - 9 9 9 E + 9 9   a n d   " N a N "   a r e   c l i p p e d   f r o m   t h e   d a t a   s e t .  
  
   U n l i k e   s t a n d a r d   X Y   g r a p h s ,   l i n e s   a r e   d r a w n   p o i n t   t o   p o i n t   i n   a n y   d i r e c t i o n  
   w i t h o u t   l i m i t a t i o n .     T h i s   a l l o w s   s t e p   f u n c t i o n s ,   c i r c l e s ,   s h a p e s ,   e t c .  
  
   T h i s   s c r i p t   d o e s   n o t   o p t i m i z e   d a t a   f o r   b e t t e r   r e s o l u t i o n ,   i t   i s   u p   t o   t h e  
   p r o g r a m m e r   t o   i n p u t   t h e   d a t a   s p a c i n g   a s   d e s i r e d .  
  
   G e n e r a t i n g   s m o o t h   o u t p u t   r e q u i r e s   i n c r e a s i n g   t h e   n u m b e r   o f   d a t a   p o i n t s   a t   t h e  
   e x p e n s e   o f   c o m p u t a t i o n   t i m e .     G e n e r a l l y ,   1 0 0 0   p o i n t s   o r   l e s s   i s   a d e q u a t e .  
    
   F o r m a t t i n g   f o r   t e x t   m a y   b e   m o d i f i e d   u s i n g   C S S .  
  
   F o r m a t t i n g   f o r   t h e   a x e s   a n d   l i n e s   m a y   b e   m o d i f i e d   u s i n g   V M L   s t y l e s ,   f o r   m o r e    
   i n f o r m a t i o n   o n   V M L   s e e   t h e   W 3 C   d e f i n i t i o n   p a g e :   h t t p : / / w w w . w 3 . o r g / T R / N O T E - V M L  
  
 = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =  
  
 " X Y L i n e "   o b j e c t   d o c u m e n t a t i o n  
  
 I n i t i a l i z e :    
 	 v a r   M y L i n e   =   n e w   X Y L i n e ( ) ;  
 	 M y L i n e . x   =   [ 1 ,   2 ,   3 ,   4 ] ;   / /   s e t   x   a n d   y   d a t a   p o i n t s  
 	 M y L i n e . l a b e l   =   " p l o t   1 " ;   / /   s e t   p r o p e r t i e s   a s   d e s i r e d  
 	 	  
 P r o p e r t i e s :    
 	 S e e   c o n s t r u c t o r   s c r i p t   w i t h   i n l i n e   c o m m e n t s   b e l o w .  
  
 = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = * /  
  
  
 f u n c t i o n   X Y L i n e ( )   {  
  
 	 / /   A r r a y s   f o r   h o l d i n g   x ,   y   c o o r d i n a t e   v a l u e s   a n d   p o i n t   l a b e l s  
  
 	 t h i s . x   =   n e w   A r r a y ( ) ;  
 	 t h i s . y   =   n e w   A r r a y ( ) ;  
 	 t h i s . l a b e l s   =   n e w   A r r a y ( ) ;  
 	  
 	 / /   A s s i g n   V M L   c o m p l i a n t   p r o p e r t i e s   f o r   t h e   l i n e .  
 	 / /   N o t e   t h a t   n o n - p r i m a r y   c o l o r s   m u s t   b e   i n   # h e x   o r   r b g ( r , g , b )   f o r m a t .  
  
 	 t h i s . V M L s t r o k e   =   " w e i g h t = ' 1 . 3 p t ' ;   c o l o r = # 3 3 3 3 9 9 ;   d a s h s t y l e = ' s o l i d ' ; " ;  
 	 t h i s . d r a w l i n e = t r u e ; 	 / /   s e t   t o   t r u e   o r   f a l s e  
  
 	 / /   A s s i g n   a   l a b e l   f o r   t h e   l i n e  
  
 	 t h i s . l a b e l   =   " l i n e " ; 	 / /   d i s p l a y e d   w h e n   m o u s e   i s   o v e r   l i n e  
 	 t h i s . l a b e l f o n t   =   " ' A r i a l ' " ;  
 	 t h i s . l a b e l s i z e   =   " 8 " ;   / /   f o n t   s i z e   i n   " p t "  
 	 t h i s . l a b e l c o l o r   =   " b l a c k " ;  
  
 	 / /   A s s i g n   a   V M L   s h a p e t y p e   f o r   p l o t t i n g   d a t a   p o i n t s ,   s e e   d e f i n i t i o n s   a t   b o t t o m   o f   s c r i p t .  
 	 / /   U s i n g   t h e   ' n o n e '   s h a p e t y p e   p l o t s   i n v i s i b l e   p o i n t s   a n d   a l l o w s   c o o r d i n a t e s   t o   b e  
 	 / /   s h o w n   w h e n   t h e   m o u s e   i s   o v e r   t h e   p o i n t .     S e t   ' d r a w p o i n t s '   t o   f a l s e   t o   t u r n   o f f  
 	 / /   t h e   p o i n t s   c o m p l e t e l y   a n d   s p e e d   u p   g r a p h i n g   f o r   e x t e n s i v e   d a t a   s e t s .     T h e   g r a p h   s c r i p t  
 	 / /   a u t o m a t i c a l l y   t u r n s   o f f   p o i n t s   i f   t h e   d a t a   s e t   h a s   m o r e   t h a n   1 0 0 0   p o i n t s .  
  
 	 t h i s . V M L p o i n t s h a p e t y p e = " d i a m o n d " ; 	 / /   [   d i a m o n d ,   s q u a r e ,   t r i a n g l e ,   c i r c l e ,   x ,   n o n e   ]  
 	 t h i s . d r a w p o i n t s = t r u e ; 	   	 / /   s e t   t o   t r u e   o r   f a l s e  
 	 t h i s . d r a w l a b e l s = f a l s e ; 	 	 / /   s e t   t o   t r u e   o r   f a l s e  
 	 t h i s . m o u s e o v e r l a b e l s = f a l s e ; 	 / /   t r u e   w i l l   s h o w   t h e   " l a b e l s "   o n   m o u s e o v e r ,   f a l s e   w i l l   s h o w   x , y   c o o r d  
  
 	 / /   A s s i g n   V M L   p r o p e r t i e s   f o r   t h e   p o i n t s  
  
 	 t h i s . p o i n t s i z e = " 5 " ; 	   	 / /   s h a p e   d i s p l a y   s i z e   i n   " p t "  
 	 t h i s . p o i n t f i l l c o l o r = " # 3 3 3 3 9 9 " ; 	 / /   p o i n t   f i l l   c o l o r  
 	 t h i s . p o i n t s t r o k e c o l o r = " # 3 3 3 3 9 9 " ; 	 / /   p o i n t   l i n e   c o l o r  
 }  
 f u n c t i o n   X Y L i n i j a ( )   {  
  
 	 / /   A r r a y s   f o r   h o l d i n g   x ,   y   c o o r d i n a t e   v a l u e s   a n d   p o i n t   l a b e l s  
  
 	 t h i s . x   =   n e w   A r r a y ( ) ;  
 	 t h i s . y   =   n e w   A r r a y ( ) ;  
 	 / / t h i s . l a b e l s   =   n e w   A r r a y ( ) ;  
 	  
 	 / /   A s s i g n   V M L   c o m p l i a n t   p r o p e r t i e s   f o r   t h e   l i n e .  
 	 / /   N o t e   t h a t   n o n - p r i m a r y   c o l o r s   m u s t   b e   i n   # h e x   o r   r b g ( r , g , b )   f o r m a t .  
  
 	 t h i s . V M L s t r o k e   =   " w e i g h t = ' 0 . 3 p t ' ;   c o l o r =   # C C 0 0 0 0 ;   d a s h s t y l e = ' s o l i d ' ; " ;  
 	 t h i s . d r a w l i n e = t r u e ; 	 / /   s e t   t o   t r u e   o r   f a l s e  
  
 	 / /   A s s i g n   a   l a b e l   f o r   t h e   l i n e  
  
 	 t h i s . l a b e l   =   " " ; 	 / /   d i s p l a y e d   w h e n   m o u s e   i s   o v e r   l i n e  
 	 t h i s . l a b e l f o n t   =   " ' A r i a l ' " ;  
 	 t h i s . l a b e l s i z e   =   " 8 " ;   / /   f o n t   s i z e   i n   " p t "  
 	 t h i s . l a b e l c o l o r   =   " # C C 0 0 0 0 " ;  
  
 	 / /   A s s i g n   a   V M L   s h a p e t y p e   f o r   p l o t t i n g   d a t a   p o i n t s ,   s e e   d e f i n i t i o n s   a t   b o t t o m   o f   s c r i p t .  
 	 / /   U s i n g   t h e   ' n o n e '   s h a p e t y p e   p l o t s   i n v i s i b l e   p o i n t s   a n d   a l l o w s   c o o r d i n a t e s   t o   b e  
 	 / /   s h o w n   w h e n   t h e   m o u s e   i s   o v e r   t h e   p o i n t .     S e t   ' d r a w p o i n t s '   t o   f a l s e   t o   t u r n   o f f  
 	 / /   t h e   p o i n t s   c o m p l e t e l y   a n d   s p e e d   u p   g r a p h i n g   f o r   e x t e n s i v e   d a t a   s e t s .     T h e   g r a p h   s c r i p t  
 	 / /   a u t o m a t i c a l l y   t u r n s   o f f   p o i n t s   i f   t h e   d a t a   s e t   h a s   m o r e   t h a n   1 0 0 0   p o i n t s .  
  
 	 t h i s . V M L p o i n t s h a p e t y p e = " d i a m o n d " ; 	 / /   [   d i a m o n d ,   s q u a r e ,   t r i a n g l e ,   c i r c l e ,   x ,   n o n e   ]  
 	 t h i s . d r a w p o i n t s = t r u e ; 	   	 / /   s e t   t o   t r u e   o r   f a l s e  
 	 t h i s . d r a w l a b e l s = f a l s e ; 	 	 / /   s e t   t o   t r u e   o r   f a l s e  
 	 t h i s . m o u s e o v e r l a b e l s = f a l s e ; 	 / /   t r u e   w i l l   s h o w   t h e   " l a b e l s "   o n   m o u s e o v e r ,   f a l s e   w i l l   s h o w   x , y   c o o r d  
  
 	 / /   A s s i g n   V M L   p r o p e r t i e s   f o r   t h e   p o i n t s  
  
 	 / / t h i s . p o i n t s i z e = " 5 " ; 	   	 / /   s h a p e   d i s p l a y   s i z e   i n   " p t "  
 	 / / t h i s . p o i n t f i l l c o l o r = # C C 0 0 0 0 ; 	 / /   p o i n t   f i l l   c o l o r  
 	 / / t h i s . p o i n t s t r o k e c o l o r = " # C C 0 0 0 0 " ; 	 / /   p o i n t   l i n e   c o l o r  
 }  
  
 f u n c t i o n   A r r o w ( )   {  
  
 	 / /   x   a n d   y   c o o r d i n a t e   v a l u e s   o f   a r r o w   o r i g i n  
  
 	 t h i s . x   =   0 ;  
 	 t h i s . y   =   0 ;  
 	 t h i s . r o t a t i o n   =   4 5 ;  
 	 t h i s . l e n g t h   =   2 5 ;  
 	  
 	 / /   A s s i g n   a   l a b e l   f o r   t h e   a r r o w  
  
 	 t h i s . l a b e l   =   " T e s t " ;  
  
 	 / /   A s s i g n   V M L   p r o p e r t i e s   f o r   t h e   a r r o w  
  
 	 t h i s . s i z e = " 1 0 " ; 	   	 / /   s h a p e   d i s p l a y   s i z e   i n   " p t "  
 	 t h i s . c o l o r = " # C C 0 0 0 0 " ; 	 / /   a r r o w   c o l o r  
 	 t h i s . l a b e l c o l o r = " # C C 0 0 0 0 " ; 	 / /   l a b e l   c o l o r  
 	 t h i s . l a b e l s i z e = " 1 2 " ; 	 / /   l a b e l   s i z e   i n   " p t "  
 	 t h i s . l i n e w e i g h t = " 2 " ;     / /   l i n e   w e i g h t   i n   " p t "  
 	 t h i s . d a s h s t y l e = " s o l i d " ;   / /   l i n e   s t y l e  
  
 	 / /   A r r o w   h e a d   s h a p e   d e f i n i t i o n  
  
 	 t h i s . a r r o w h e a d = ' < v : s h a p e t y p e   i d = " a r r o w h e a d "   c o o r d s i z e = " 5 0 0 , 5 0 0 "   p a t h = "   m   0   0   l   2 5 0   5 0 0   5 0 0   0   2 5 0   1 0 0   x   e "   / > ' ;  
  
 }   / /   e n d   f u n c t i o n  
  
  
  
 f u n c t i o n   L a b e l ( )   {  
  
 	 / /   x   a n d   y   c o o r d i n a t e   v a l u e s   o f   t h e   l a b e l   o r i g i n  
  
 	 t h i s . x   =   0 ;  
 	 t h i s . y   =   0 ;  
 	 t h i s . r o t a t i o n   =   4 5 ;  
 	 t h i s . l e n g t h   =   0 ;  
  
 	  
 	 / /   A s s i g n   a   l a b e l   t e x t  
  
 	 t h i s . l a b e l   =   " " ;  
  
 	 / /   A s s i g n   V M L   p r o p e r t i e s   f o r   t h e   l a b e l  
  
 	 t h i s . l a b e l c o l o r = " # 8 0 0 0 0 0 " ; 	 / /   l a b e l   c o l o r  
 	 t h i s . l a b e l s i z e = " 7 " ; 	 / /   l a b e l   s i z e   i n   " p t "  
  
 	 t h i s . V M L p o i n t s h a p e t y p e = " c i r c l e " ; 	 / /   [   d i a m o n d ,   s q u a r e ,   t r i a n g l e ,   c i r c l e ,   x ,   n o n e   ]  
  
 	 t h i s . p o i n t s i z e = " 4 " ; 	   	 / /   s h a p e   d i s p l a y   s i z e   i n   " p t "  
 	 t h i s . p o i n t f i l l c o l o r = " # C C 0 0 0 0 " ; 	 / /   p o i n t   f i l l   c o l o r  
 	 t h i s . p o i n t s t r o k e c o l o r = " # C C 0 0 0 0 " ; 	 / /   p o i n t   l i n e   c o l o r  
  
 }   / /   e n d   f u n c t i o n  
  
  
  
  
 f u n c t i o n   X Y G r a p h ( )   {  
  
     / /   D a t a   P r o p e r t i e s  
  
 	 / /   T h e   m a x   a n d   m i n   v a l u e s   d e f i n e   t h e   u p p e r   a n d   l o w e r   a x i s   v a l u e s   t o   d i s p l a y .  
 	 / /   I f   n o t   s p e c i f i e d   t h e y   w i l l   a u t o m a t i c a l l y   f i t   t o   t h e   d a t a   l i m i t s .  
  
 	 t h i s . x m a x = n u l l ;  
 	 t h i s . x m i n = n u l l ;  
 	 t h i s . y m a x = n u l l ;    
 	 t h i s . y m i n = n u l l ;  
  
 	 / /   G r a p h   t i t l e s  
  
 	 t h i s . t i t l e = n u l l ;  
 	 t h i s . x a x i s = n u l l ;  
 	 t h i s . y a x i s = n u l l ;  
  
 	 / /   T i c   s c a l e   s p a c i n g ,   i f   n o t   s p e c i f i e d   i t   w i l l   b e   f i t   t o   t h e   d a t a .  
  
 	 t h i s . x s c a l e = n u l l ;  
 	 t h i s . y s c a l e = n u l l ;  
  
 	 / /   V a l u e   w h e r e   t h e   a x e s   c r o s s .     D e f a u l t   i s   a t   0 , 0  
 	 / /   S e t   t o   " N u m b e r . N E G A T I V E _ I N F I N I T Y "   t o   a l i g n   w i t h   t h e   m i n i m u m   a x i s   v a l u e .  
 	 / /   S e t   t o   " N u m b e r . P O S I T I V E _ I N F I N I T Y "   t o   a l i g n   w i t h   t h e   m a x i m u m   a x i s   v a l u e .  
  
 	 t h i s . x i n t = 0 ;  
 	 t h i s . y i n t = 0 ;  
  
 	 / /   T h e   l a s t   p l o t   s t r i n g   g e n e r a t e d   i s   m a i n t a i n e d   i n   m e m o r y  
  
 	 t h i s . l a s t p l o t = " " ;  
  
 	 / /   T r a c k s   t h e   c h a n g e s   m a d e   f r o m   a d d i t i o n a l   p l o t s   f o r   u s e   w i t h   D e l e t e L a s t ( )  
  
 	 t h i s . l a s t p l o t a d d e d =   n e w   A r r a y ( ) ;  
 	 t h i s . n u m p l o t s = 0 ;  
  
     / /   S t y l e   P r o p e r t i e s  
  
 	 t h i s . g h e i g h t = 2 0 0 ; 	 / /   P l o t t i n g   h e i g h t   i n   " p t "  
 	 t h i s . g w i d t h = 4 0 0 ; 	 / /   P l o t t i n g   w i d t h   i n   " p t "  
 	 t h i s . p a d _ t o p = 1 5 ; 	 / /   I n t e r n a l   p a d d i n g   m a r g i n s   i n   " p t "  
 	 t h i s . p a d _ b o t t o m = 1 0 ;  
 	 t h i s . p a d _ l e f t = 1 5 ;  
 	 t h i s . p a d _ r i g h t = 1 5 ;  
  
 	 t h i s . t i c s i z e = 5 ;   	 / /   T i c   s i z e   i n   " p t " ,   s e t   t o   " 0 "   t o   t u r n   o f f  
 	 t h i s . t i c s p a c e a v g = 3 0 ; 	 / /   A v e r a g e   a u t o   t i c   s p a c i n g   i n   " p t "  
 	 t h i s . x t i c l o c = " a u t o " ; 	 / /   x - a x i s   l a b e l s   " t o p " ,   " b o t t o m " ,   " a u t o "   o r   " n o n e "  
 	 t h i s . y t i c l o c = " a u t o " ; 	 / /   y - a x i s   l a b e l s   " r i g h t " ,   " l e f t " ,   " a u t o "   o r   " n o n e "  
 	 t h i s . u s e r x t i c l a b e l s = n u l l ; 	 / /   a l l o w s   t h e   u s e r   t o   o v e r r i d e   x   a x i s   t i c   l a b e l s  
 	 t h i s . u s e r y t i c l a b e l s = n u l l ; 	 / /   a l l o w s   t h e   u s e r   t o   o v e r r i d e   y   a x i s   t i c   l a b e l s  
  
 	 t h i s . V M L m i n o r x a x i s s t r o k e   =   " w e i g h t = ' 0 . 5 p t ' ;   c o l o r = ' # D 3 D 3 D 3 ' ;   d a s h s t y l e = ' d a s h ' ; " ;  
 	 t h i s . V M L m i n o r y a x i s s t r o k e   =   " w e i g h t = ' 0 . 5 p t ' ;   c o l o r = ' # D 3 D 3 D 3 ' ;   d a s h s t y l e = ' d a s h ' ; " ;  
 	 t h i s . V M L m a j o r a x i s s t r o k e   =   " w e i g h t = ' 1 p t ' ;   c o l o r = ' b l a c k ' ; " ;  
 	 t h i s . V M L b a c k g r o u n d f i l l   =   " c o l o r = ' w h i t e ' " ;  
 	 t h i s . V M L f r a m e s t r o k e   =   " c o l o r = ' w h i t e ' " ;  
  
 	 t h i s . C S S t i c f o n t   =   " f o n t :   8 p t   ' A r i a l ' ; " ;  
 	 t h i s . C S S t i t l e f o n t   =   " f o n t :   1 0 p t   ' A r i a l ' ;   f o n t - w e i g h t :   b o l d ; " ;     / /   f o n t   s i z e s   m u s t   b e   s e t   i n   " p t "  
 	 t h i s . C S S x a x i s f o n t   =   " f o n t :   8 p t   ' A r i a l ' ;   f o n t - w e i g h t :   b o l d ; " ;  
 	 t h i s . C S S y a x i s f o n t   =   " f o n t :   8 p t   ' A r i a l ' ;   f o n t - w e i g h t :   b o l d ; " ;  
 	 t h i s . V M L y a x i s f o n t c o l o r   =   " b l a c k " ;     / /   m u s t   s p e c i f y   y - a x i s   t i t l e   f o n t   c o l o r   s i n c e   i t   i s   V M L   o b j e c t  
  
 }  
  
 X Y G r a p h . p r o t o t y p e . t o S t r i n g   =   f u n c t i o n ( )   { r e t u r n   t h i s . l a s t p l o t ; }   / /   T h e   o b j e c t   w i l l   e v a l u a t e   t o   t h e   l a s t   p l o t  
  
  
  
 X Y G r a p h . p r o t o t y p e . P l o t   =   f u n c t i o n   ( X Y L i n e )   {  
  
 / /   P a r s e   i n p u t   t o   d e t e r m i n e   x , y   d a t a   l i m i t s   a n d   c l i p   e x t r e m e   v a l u e s  
 	 l i n e s   =   a r g u m e n t s ;    
 	 x m a x   =   N u m b e r . N E G A T I V E _ I N F I N I T Y ;   x m i n   =   N u m b e r . P O S I T I V E _ I N F I N I T Y ;  
 	 y m a x   =   N u m b e r . N E G A T I V E _ I N F I N I T Y ;   y m i n   =   N u m b e r . P O S I T I V E _ I N F I N I T Y ;  
 	 c l i p x m a x   =   ( t h i s . x m a x   ?   N u m b e r ( t h i s . x m a x )   :   9 9 9 E + 9 9 ) ;    
 	 c l i p x m i n   =   ( t h i s . x m i n   ?   N u m b e r ( t h i s . x m i n )   :   - 9 9 9 E + 9 9 ) ;  
 	 c l i p y m a x   =   ( t h i s . y m a x   ?   N u m b e r ( t h i s . y m a x )   :   9 9 9 E + 9 9 ) ;  
 	 c l i p y m i n   =   ( t h i s . y m i n   ?   N u m b e r ( t h i s . y m i n )   :   - 9 9 9 E + 9 9 ) ;  
 	 c l i p p e d = f a l s e ;  
  
 / /   f i x   i n p u t  
 	 t h i s . y i n t   =   N u m b e r ( t h i s . y i n t ) ;   t h i s . x i n t   =   N u m b e r ( t h i s . x i n t ) ;  
 	 t h i s . y m i n   =   N u m b e r ( t h i s . y m i n ) ;   t h i s . x m i n   =   N u m b e r ( t h i s . x m i n ) ;  
 	 t h i s . y m a x   =   N u m b e r ( t h i s . y m a x ) ;   t h i s . x m a x   =   N u m b e r ( t h i s . x m a x ) ;  
  
 	 i f   ( t h i s . x m a x   <   t h i s . x m i n   & &   t h i s . x m a x )   { t e m p = t h i s . x m a x ;   t h i s . x m a x = t h i s . x m i n ;   t h i s . x m i n = t e m p ; }    
 	 i f   ( t h i s . y m a x   <   t h i s . y m i n   & &   t h i s . y m a x )   { t e m p = t h i s . y m a x ;   t h i s . y m a x = t h i s . y m i n ;   t h i s . y m i n = t e m p ; }  
  
 	 x m a x = t h i s . x m a x ;   x m i n = t h i s . x m i n ;   y m a x = t h i s . y m a x ;   y m i n = t h i s . y m i n ;  
  
     f o r   ( v a r   n = 0 ;   n < l i n e s . l e n g t h ;   n + + )   {  
 	 v a r   j = 0 ;   t e m p x   =   n e w   A r r a y ( ) ;   t e m p y   =   n e w   A r r a y ( ) ;   t e m p l a b e l s   =   n e w   A r r a y ( ) ;  
 	 l i n e l e n   =   ( l i n e s [ n ] . y . l e n g t h   >   l i n e s [ n ] . x . l e n g t h   ?   l i n e s [ n ] . x . l e n g t h   :   l i n e s [ n ] . y . l e n g t h ) ;  
 	 f o r   ( v a r   i = 0 ;   i < l i n e l e n ;   i + + )   {  
 	 	 i f   ( ( l i n e s [ n ] . x [ i ]   < =   c l i p x m a x ) & & ( l i n e s [ n ] . x [ i ]   > =   c l i p x m i n ) & & ( l i n e s [ n ] . y [ i ]   < =   c l i p y m a x ) & & ( l i n e s [ n ] . y [ i ]   > =   c l i p y m i n ) & & ( i < = 1 0 0 0 ) )   {  
 	 	 	 i f   ( x m a x   <   l i n e s [ n ] . x [ i ] )   { x m a x   =   l i n e s [ n ] . x [ i ] } ;  
 	 	 	 i f   ( x m i n   >   l i n e s [ n ] . x [ i ] )   { x m i n   =   l i n e s [ n ] . x [ i ] } ;  
 	 	 	 i f   ( y m a x   <   l i n e s [ n ] . y [ i ] )   { y m a x   =   l i n e s [ n ] . y [ i ] } ;  
 	 	 	 i f   ( y m i n   >   l i n e s [ n ] . y [ i ] )   { y m i n   =   l i n e s [ n ] . y [ i ] } ;  
 	 	 	 t e m p x [ j ] = l i n e s [ n ] . x [ i ] ;    
 	 	 	 t e m p y [ j ] = l i n e s [ n ] . y [ i ] ;  
 	 	 	 i f ( l i n e s [ n ] . d r a w l a b e l s   | |   l i n e s [ n ] . m o u s e o v e r l a b e l s )   { t e m p l a b e l s [ j ] =   l i n e s [ n ] . l a b e l s [ j ] ; }  
 	 	 	 j + + ;  
 	 	 }  
 	 	 e l s e   i f   ( i s N a N ( l i n e s [ n ] . x [ i ] )   | |   i s N a N ( l i n e s [ n ] . y [ i ] ) )   { c l i p p e d = t r u e ; }  
 	 	 e l s e   i f   ( ( ( l i n e s [ n ] . x [ i + 1 ]   < =   c l i p x m a x ) & & ( l i n e s [ n ] . x [ i + 1 ]   > =   c l i p x m i n ) & & ( l i n e s [ n ] . y [ i + 1 ]   < =   c l i p y m a x ) & & ( l i n e s [ n ] . y [ i + 1 ]   > =   c l i p y m i n ) & & ( i < = 1 0 0 0 ) ) )   {  
 	 	 	 l a s t x y   =   t h i s . F i n d e d g e ( l i n e s [ n ] . x [ i + 1 ] , l i n e s [ n ] . x [ i ] , l i n e s [ n ] . y [ i + 1 ] , l i n e s [ n ] . y [ i ] , c l i p x m a x , c l i p x m i n , c l i p y m a x , c l i p y m i n ) ;  
 	 	 	 i f   ( M a t h . a b s ( l a s t x y [ 0 ] )   <   9 9 9 E + 9 9   & &   M a t h . a b s ( l a s t x y [ 1 ] )   <   9 9 9 E + 9 9 )   {  
 	 	 	 	 t e m p x [ j ] = l a s t x y [ 0 ] ;   t e m p y [ j ] = l a s t x y [ 1 ] ;    
 	 	 	 	 i f ( l i n e s [ n ] . d r a w l a b e l s   | |   l i n e s [ n ] . m o u s e o v e r l a b e l s )   { t e m p l a b e l s [ j ] = " " ; }  
 	 	 	 	 j + + ;  
 	 	 	 }  
 	 	 	 c l i p p e d = t r u e ;    
 	 	 }  
 	 	 e l s e   i f   ( ( ( l i n e s [ n ] . x [ i - 1 ]   < =   c l i p x m a x ) & & ( l i n e s [ n ] . x [ i - 1 ]   > =   c l i p x m i n ) & & ( l i n e s [ n ] . y [ i - 1 ]   < =   c l i p y m a x ) & & ( l i n e s [ n ] . y [ i - 1 ]   > =   c l i p y m i n ) ) & & ( i < = 1 0 0 0 ) )   {  
 	 	 	 l a s t x y   =   t h i s . F i n d e d g e ( l i n e s [ n ] . x [ i - 1 ] , l i n e s [ n ] . x [ i ] , l i n e s [ n ] . y [ i - 1 ] , l i n e s [ n ] . y [ i ] , c l i p x m a x , c l i p x m i n , c l i p y m a x , c l i p y m i n ) ;  
 	 	 	 i f   ( M a t h . a b s ( l a s t x y [ 0 ] )   <   9 9 9 E + 9 9   & &   M a t h . a b s ( l a s t x y [ 1 ] )   <   9 9 9 E + 9 9 )   {  
 	 	 	 	 t e m p x [ j ] = l a s t x y [ 0 ] ;   t e m p y [ j ] = l a s t x y [ 1 ] ;    
 	 	 	 	 i f ( l i n e s [ n ] . d r a w l a b e l s   | |   l i n e s [ n ] . m o u s e o v e r l a b e l s )   { t e m p l a b e l s [ j ] = " " ; }  
 	 	 	 	 j + + ;  
 	 	 	 }  
 	 	 	 i f   ( i + 1   ! =   l i n e l e n )   {  
 	 	 	 l i n e s . l e n g t h   + =   1 ;  
 	 	 	 l i n e s [ ( l i n e s . l e n g t h - 1 ) ]   =   n e w   A r r a y ( ) ;  
 	 	 	 l i n e s [ ( l i n e s . l e n g t h - 1 ) ] . V M L s t r o k e   =   l i n e s [ n ] . V M L s t r o k e ;  
 	 	 	 l i n e s [ ( l i n e s . l e n g t h - 1 ) ] . d r a w l i n e   =   l i n e s [ n ] . d r a w l i n e ;  
 	 	 	 l i n e s [ ( l i n e s . l e n g t h - 1 ) ] . l a b e l   =   l i n e s [ n ] . l a b e l ;  
 	 	 	 l i n e s [ ( l i n e s . l e n g t h - 1 ) ] . V M L p o i n t s h a p e t y p e   =   l i n e s [ n ] . V M L p o i n t s h a p e t y p e ;  
 	 	 	 l i n e s [ ( l i n e s . l e n g t h - 1 ) ] . p o i n t s i z e   =   l i n e s [ n ] . p o i n t s i z e ;  
 	 	 	 l i n e s [ ( l i n e s . l e n g t h - 1 ) ] . p o i n t f i l l c o l o r   =   l i n e s [ n ] . p o i n t f i l l c o l o r ;  
 	 	 	 l i n e s [ ( l i n e s . l e n g t h - 1 ) ] . p o i n t s t r o k e c o l o r   =   l i n e s [ n ] . p o i n t s t r o k e c o l o r ;  
 	 	 	 l i n e s [ ( l i n e s . l e n g t h - 1 ) ] . d r a w p o i n t s   =   l i n e s [ n ] . d r a w p o i n t s ;  
 	 	 	 l i n e s [ ( l i n e s . l e n g t h - 1 ) ] . l a b e l s i z e   =   l i n e s [ n ] . l a b e l s i z e ;  
 	 	 	 l i n e s [ ( l i n e s . l e n g t h - 1 ) ] . l a b e l f o n t   =   l i n e s [ n ] . l a b e l f o n t ;  
 	 	 	 l i n e s [ ( l i n e s . l e n g t h - 1 ) ] . l a b e l c o l o r   =   l i n e s [ n ] . l a b e l c o l o r ;  
 	 	 	 l i n e s [ ( l i n e s . l e n g t h - 1 ) ] . d r a w l a b e l s   =   l i n e s [ n ] . d r a w l a b e l s ;  
 	 	 	 l i n e s [ ( l i n e s . l e n g t h - 1 ) ] . m o u s e o v e r l a b e l s   =   l i n e s [ n ] . m o u s e o v e r l a b e l s ;  
 	 	 	 l i n e s [ ( l i n e s . l e n g t h - 1 ) ] . x = l i n e s [ n ] . x . s l i c e ( i ) ;  
 	 	 	 l i n e s [ ( l i n e s . l e n g t h - 1 ) ] . y = l i n e s [ n ] . y . s l i c e ( i ) ;    
 	 	 	 l i n e s [ n ] . x = t e m p x ;   l i n e s [ n ] . y = t e m p y ;    
 	 	 	 i f ( l i n e s [ n ] . d r a w l a b e l s   | |   l i n e s [ n ] . m o u s e o v e r l a b e l s )   {  
 	 	 	 	 l i n e s [ ( l i n e s . l e n g t h - 1 ) ] . l a b e l s = l i n e s [ n ] . l a b e l s . s l i c e ( i ) ;  
 	 	 	 	 l i n e s [ n ] . l a b e l s = t e m p l a b e l s ;  
 	 	 	 }  
 	 	 	 c l i p p e d = t r u e ;  
  
 	 	 	 b r e a k ;    
 	 	 	 }  
 	 	 }  
 	 	 e l s e   i f   ( i   >   1 0 0 0 )   {  
 	 	 	 l i n e s [ n ] . d r a w p o i n t s   =   f a l s e ;  
 	 	 	 l i n e s [ n ] . d r a w l a b e l s   =   f a l s e ;  
 	 	 	 l i n e s . l e n g t h   + =   1 ;  
 	 	 	 l i n e s [ ( l i n e s . l e n g t h - 1 ) ]   =   n e w   A r r a y ( ) ;  
 	 	 	 l i n e s [ ( l i n e s . l e n g t h - 1 ) ] . V M L s t r o k e   =   l i n e s [ n ] . V M L s t r o k e ;  
 	 	 	 l i n e s [ ( l i n e s . l e n g t h - 1 ) ] . d r a w l i n e   =   l i n e s [ n ] . d r a w l i n e ;  
 	 	 	 l i n e s [ ( l i n e s . l e n g t h - 1 ) ] . l a b e l   =   l i n e s [ n ] . l a b e l ;  
 	 	 	 l i n e s [ ( l i n e s . l e n g t h - 1 ) ] . d r a w p o i n t s   =   f a l s e ;  
 	 	 	 l i n e s [ ( l i n e s . l e n g t h - 1 ) ] . d r a w l a b e l s   =   f a l s e ;  
 	 	 	 l i n e s [ ( l i n e s . l e n g t h - 1 ) ] . x = l i n e s [ n ] . x . s l i c e ( i - 1 ) ;  
 	 	 	 l i n e s [ ( l i n e s . l e n g t h - 1 ) ] . y = l i n e s [ n ] . y . s l i c e ( i - 1 ) ;    
 	 	 	 l i n e s [ n ] . x = t e m p x ;   l i n e s [ n ] . y = t e m p y ;  
  
 	 	 	 b r e a k ;    
 	 	 }  
 	 	 e l s e   { c l i p p e d = t r u e ; }  
 	 }  
 	 l i n e s [ n ] . x = t e m p x ;   l i n e s [ n ] . y = t e m p y ;   l i n e s [ n ] . l a b e l s = t e m p l a b e l s ;  
     }  
  
 	 i f   ( t h i s . x i n t   = =   N u m b e r . N E G A T I V E _ I N F I N I T Y )   { t h i s . x i n t   =   x m i n ; }  
 	 i f   ( t h i s . x i n t   = =   N u m b e r . P O S I T I V E _ I N F I N I T Y )   { t h i s . x i n t   =   x m a x ; }  
 	 i f   ( t h i s . y i n t   = =   N u m b e r . N E G A T I V E _ I N F I N I T Y )   { t h i s . y i n t   =   y m i n ; }  
 	 i f   ( t h i s . y i n t   = =   N u m b e r . P O S I T I V E _ I N F I N I T Y )   { t h i s . y i n t   =   y m a x ; }  
  
  
  
 / /   I n t i a l i z e   d a t a  
  
 i f   ( t h i s . l a s t p l o t   = =   " " )   {   / /   d o n ' t   r e d r a w   g r a p h   b a c k g r o u n d   i f   c a l l e d   m u l t i p l e   t i m e s  
  
 	 x s c a l e = N u m b e r ( t h i s . x s c a l e ) ;   y s c a l e = N u m b e r ( t h i s . y s c a l e ) ;  
 	 x i n t = N u m b e r ( t h i s . x i n t ) ;   y i n t = N u m b e r ( t h i s . y i n t ) ;  
  
 	 g h e i g h t = N u m b e r ( t h i s . g h e i g h t ) ;   g w i d t h = N u m b e r ( t h i s . g w i d t h ) ;  
 	 t i c s i z e = N u m b e r ( t h i s . t i c s i z e ) ;  
  
 	 x t i c l o c = t h i s . x t i c l o c ;   y t i c l o c = t h i s . y t i c l o c ;  
  
 / /   I n i t i a l i z e   p a r a m e t e r s  
  
 	 g x p t = 1 0 0 ;  
 	 p a d _ t = g x p t * t h i s . p a d _ t o p ;   p a d _ b = g x p t * t h i s . p a d _ b o t t o m ;   / /   p a d d i n g  
 	 p a d _ l = g x p t * t h i s . p a d _ l e f t ;   p a d _ r = g x p t * t h i s . p a d _ r i g h t ;    
 	 g w t = M a t h . a b s ( M a t h . r o u n d ( g w i d t h * g x p t ) ) ;   / /   t o t a l   g r a p h   w i d t h ;  
 	 g h t = M a t h . a b s ( M a t h . r o u n d ( g h e i g h t * g x p t ) ) ;   / /   t o t a l   g r a p h   h e i g h t ;  
  
 	 g s t y l e = ' p o s i t i o n : a b s o l u t e ;   w i d t h = ' + g w t + ' ;   h e i g h t = ' + g h t ;   / /   r e p e t i t i v e   s t r i n g   c o n s t a n t  
 	 G X s t y l e = t h i s . C S S t i c f o n t + ' p o s i t i o n : a b s o l u t e ; ' ;  
 	 G Y s t y l e = t h i s . C S S t i c f o n t + ' p o s i t i o n : a b s o l u t e ; ' ;  
 	 G Y L s t y l e = t h i s . C S S t i c f o n t + ' p o s i t i o n : a b s o l u t e ;   t e x t - a l i g n : r i g h t ;   w i d t h : ' ;   / /   f i n i s h e d   l a t e r  
  
 / /   f i x   a u t o   s c a l e   x   a x i s  
 	 i f   ( x i n t   <   x m i n )   { x m i n = x i n t ; }  
 	 i f   ( x i n t   >   x m a x )   { x m a x = x i n t ; }  
  
 / /   x   a u t o   t i c   s c a l e  
           i f   ( x s c a l e   < =   0 )   {  
 	 x t i c m a x = ( g w i d t h - ( p a d _ r + p a d _ l ) / g x p t ) / t h i s . t i c s p a c e a v g ;  
 	 t i c d i v i s i o n = [ 0 . 1 , 0 . 2 , 0 . 2 5 , 0 . 5 ] ;  
 	 d i v p o w = 0 ;  
 	 i = 0 ;  
 	     w h i l e   ( ( x m a x - x m i n ) / ( t i c d i v i s i o n [ i ] * M a t h . p o w ( 1 0 , d i v p o w ) )   >   x t i c m a x )   {    
 	         i + + ;    
 	         i f   ( ! ( i   %   t i c d i v i s i o n . l e n g t h ) )   { d i v p o w + + ;   i = 0 ; }  
 	         i f   ( d i v p o w > 1 )   { x t i c m a x = ( g w i d t h - ( p a d _ r + p a d _ l ) / g x p t ) / ( N u m b e r ( t h i s . t i c s p a c e a v g ) + 5 ) ; }  
 	     }  
 	 i f   ( i = = 0   & &   d i v p o w = = 0 )   {  
 	     i = t i c d i v i s i o n . l e n g t h - 1 ;   d i v p o w = - 1 ;   x t i c m a x = ( g w i d t h - ( p a d _ r + p a d _ l ) / g x p t ) / ( N u m b e r ( t h i s . t i c s p a c e a v g ) + 1 0 ) ;  
 	     w h i l e   ( ( x m a x - x m i n ) / ( t i c d i v i s i o n [ i ] * M a t h . p o w ( 1 0 , d i v p o w ) )   <   x t i c m a x )   {    
 	         i - - ;    
 	         i f   ( i = = - 1 )   { d i v p o w - - ;   i = t i c d i v i s i o n . l e n g t h - 1 ;   x t i c m a x = ( g w i d t h - ( p a d _ r + p a d _ l ) / g x p t ) / ( N u m b e r ( t h i s . t i c s p a c e a v g ) + 3 0 ) ; }  
 	     }  
 	 }  
 	 x s c a l e = t i c d i v i s i o n [ i ] * M a t h . p o w ( 1 0 , d i v p o w ) ;  
           }  
  
  
 / /   f i x   a u t o   s c a l e   y   a x i s  
 	 i f   ( y i n t   <   y m i n )   { y m i n   =   y i n t ; }  
 	 i f   ( y i n t   >   y m a x )   { y m a x   =   y i n t ; }  
  
 / /   y   a u t o   t i c   s c a l e  
           i f   ( y s c a l e   < =   0 )   {  
 	 y t i c m a x = ( g h e i g h t - ( p a d _ t + p a d _ b ) / g x p t ) / t h i s . t i c s p a c e a v g ;  
 	 t i c d i v i s i o n = [ 0 . 1 , 0 . 2 , 0 . 2 5 , 0 . 5 ] ;  
 	 d i v p o w = 0 ;  
 	 i = 0 ;  
 	     w h i l e   ( ( y m a x - y m i n ) / ( t i c d i v i s i o n [ i ] * M a t h . p o w ( 1 0 , d i v p o w ) )   >   y t i c m a x )   {    
 	         i + + ;    
 	         i f   ( ! ( i   %   t i c d i v i s i o n . l e n g t h ) )   { d i v p o w + + ;   i = 0 ; }  
 	         i f   ( d i v p o w > 1 )   { y t i c m a x = ( g w i d t h - ( p a d _ t + p a d _ b ) / g x p t ) / ( N u m b e r ( t h i s . t i c s p a c e a v g ) + 5 ) ; }  
 	     }  
 	 i f   ( i = = 0   & &   d i v p o w = = 0 )   {  
 	     i = t i c d i v i s i o n . l e n g t h - 1 ;   d i v p o w = - 1 ;   y t i c m a x = ( g h e i g h t - ( p a d _ t + p a d _ b ) / g x p t ) / ( t h i s . t i c s p a c e a v g + 1 0 ) ;  
 	     w h i l e   ( ( y m a x - y m i n ) / ( t i c d i v i s i o n [ i ] * M a t h . p o w ( 1 0 , d i v p o w ) )   <   y t i c m a x )   {    
 	         i - - ;    
 	         i f   ( i = = - 1 )   { d i v p o w - - ;   i = t i c d i v i s i o n . l e n g t h - 1 ;   y t i c m a x = ( g h e i g h t - ( p a d _ t + p a d _ b ) / g x p t ) / ( t h i s . t i c s p a c e a v g + 3 0 ) ; }  
 	     }  
 	 }  
 	 y s c a l e = t i c d i v i s i o n [ i ] * M a t h . p o w ( 1 0 , d i v p o w ) ;  
           }  
  
 / /   f i x   a u t o   s c a l e   y   a x i s  
 	 i f   ( ! c l i p p e d )   {  
 	 	 y m i n   =   ( y m i n % y s c a l e   ?   y m i n - y m i n % y s c a l e - y s c a l e   :   y m i n ) ;  
 	 	 y m a x   =   ( y m a x % y s c a l e   ?   y m a x - y m a x % y s c a l e + y s c a l e   :   y m a x ) ;  
 	 }  
  
  
 / /   D e t e r m i n e   x   t i c   l a b e l s  
  
 	 x t i c l a b e l s   =   n e w   A r r a y ( ) ;   x t i c c h a r n u m = 1 ;  
 	 n u m x t i c l e f t   =   M a t h . f l o o r ( ( x i n t - x m i n ) / x s c a l e ) ;    
 	 n u m x t i c   =   n u m x t i c l e f t + M a t h . f l o o r ( ( x m a x - x i n t ) / x s c a l e ) + 1 ;  
 	 f o r   ( v a r   i = 0 ;   i < n u m x t i c ;   i + + )   {  
 	 	 x t i c l a b e l = ( i - n u m x t i c l e f t ) * x s c a l e + x i n t ;      
 	 	 n e g s t r = " " ;   e x p s t r = 0 ;  
 	 	 i f   ( x t i c l a b e l   <   0 )   { x t i c l a b e l * = - 1 ;   n e g s t r = " - " ; }  
 	 	 s w i t c h   ( t r u e )   { 	  
 	 	 c a s e   ( x t i c l a b e l   >   9 9 9 9 9 )   :    
 	 	 	 w h i l e   ( x t i c l a b e l > = 1 0 0 0 )   { x t i c l a b e l / = 1 0 0 0 ;   e x p s t r + + ; }  
 	 	 	 x t i c l a b e l = S t r i n g ( x t i c l a b e l ) . s l i c e ( 0 , 4 ) ;  
 	 	 	 x t i c l a b e l s [ i ] = n e g s t r + x t i c l a b e l + " E + " + ( e x p s t r * 3 ) ;  
 	 	 	 b r e a k ;  
 	 	 c a s e   ( x t i c l a b e l   <   0 . 0 0 1   & &   x t i c l a b e l ! = 0 )   :    
 	 	 	 w h i l e   ( x t i c l a b e l < = 0 . 0 0 1 )   { x t i c l a b e l * = 1 0 0 0 ;   e x p s t r + + ; }  
 	 	 	 x t i c l a b e l = ( M a t h . r o u n d ( x t i c l a b e l * M a t h . p o w ( 1 0 , 4 ) ) ) / M a t h . p o w ( 1 0 , 4 ) ;  
 	 	 	 x t i c l a b e l s [ i ] = n e g s t r + x t i c l a b e l + " E - " + ( e x p s t r * 3 ) ;  
 	 	 	 b r e a k ;  
 	 	 d e f a u l t :  
 	 	 	 x t i c l a b e l = ( M a t h . r o u n d ( x t i c l a b e l * M a t h . p o w ( 1 0 , 3 ) ) ) / M a t h . p o w ( 1 0 , 3 ) ;  
 	 	 	 x t i c l a b e l s [ i ] = n e g s t r + S t r i n g ( x t i c l a b e l ) . s l i c e ( 0 , 6 ) ;  
 	 	 	 b r e a k ;  
 	 	 }    
 	 	 x t i c c h a r n u m = M a t h . m a x ( x t i c c h a r n u m , S t r i n g ( x t i c l a b e l s [ i ] ) . l e n g t h ) ;  
 	 }  
 	 x t i c c h a r n u m l a s t = S t r i n g ( x t i c l a b e l s [ i - 1 ] ) . l e n g t h ;  
  
 	 i f   ( t h i s . u s e r x t i c l a b e l s ! = n u l l )   {  
 	 l e n = M a t h . m i n ( t h i s . u s e r x t i c l a b e l s . l e n g t h , x t i c l a b e l s . l e n g t h ) ;  
 	 f o r   ( v a r   i = 0 ;   i < l e n ;   i + + )   {  
 	 	 x t i c l a b e l s [ i ] = t h i s . u s e r x t i c l a b e l s [ i ] ;  
 	 } }  
  
  
 / /   D e t e r m i n e   y   t i c   l a b e l s  
  
 	 y t i c l a b e l s   =   n e w   A r r a y ( ) ;   y t i c c h a r n u m = 0 ;  
 	 n u m y t i c b o t   =   M a t h . f l o o r ( ( y i n t - y m i n ) / y s c a l e ) ;  
 	 n u m y t i c   =   n u m y t i c b o t + M a t h . f l o o r ( ( y m a x - y i n t ) / y s c a l e ) + 1 ;  
 	 f o r   ( v a r   i = 0 ;   i < n u m y t i c ;   i + + )   {  
 	 	 y t i c l a b e l = ( i - n u m y t i c b o t ) * y s c a l e + y i n t ;  
 	 	 n e g s t r = " " ;   e x p s t r = 0 ;  
 	 	 i f   ( y t i c l a b e l   <   0 )   { y t i c l a b e l * = - 1 ;   n e g s t r = " - " ; }  
 	 	 s w i t c h   ( t r u e )   {    
 	 	 c a s e   ( y t i c l a b e l   >   9 9 9 9 9 )   :    
 	 	 	 w h i l e   ( y t i c l a b e l > = 1 0 0 0 )   { y t i c l a b e l / = 1 0 0 0 ;   e x p s t r + + ; }  
 	 	 	 y t i c l a b e l = S t r i n g ( y t i c l a b e l ) . s l i c e ( 0 , 4 ) ;  
 	 	 	 y t i c l a b e l s [ i ] = n e g s t r + y t i c l a b e l + " E + " + ( e x p s t r * 3 ) ;  
 	 	 	 b r e a k ;  
 	 	 c a s e   ( y t i c l a b e l   <   0 . 0 0 1   & &   y t i c l a b e l ! = 0 )   :    
 	 	 	 w h i l e   ( y t i c l a b e l < = 0 . 0 0 1 )   { y t i c l a b e l * = 1 0 0 0 ;   e x p s t r + + ; }  
 	 	 	 y t i c l a b e l = ( M a t h . r o u n d ( y t i c l a b e l * M a t h . p o w ( 1 0 , 4 ) ) ) / M a t h . p o w ( 1 0 , 4 ) ;  
 	 	 	 y t i c l a b e l s [ i ] = n e g s t r + y t i c l a b e l + " E - " + ( e x p s t r * 3 ) ;  
 	 	 	 b r e a k ;  
 	 	 d e f a u l t :  
 	 	 	 y t i c l a b e l = ( M a t h . r o u n d ( y t i c l a b e l * M a t h . p o w ( 1 0 , 3 ) ) ) / M a t h . p o w ( 1 0 , 3 ) ;  
 	 	 	 y t i c l a b e l s [ i ] = n e g s t r + S t r i n g ( y t i c l a b e l ) . s l i c e ( 0 , 6 ) ;  
 	 	 	 b r e a k ;  
 	 	 }    
 	 	 y t i c c h a r n u m = M a t h . m a x ( y t i c c h a r n u m , S t r i n g ( y t i c l a b e l s [ i ] ) . l e n g t h ) ;  
 	 }  
  
 	 i f   ( t h i s . u s e r y t i c l a b e l s ! = n u l l )   {  
 	 l e n = M a t h . m i n ( t h i s . u s e r y t i c l a b e l s . l e n g t h , y t i c l a b e l s . l e n g t h ) ;  
 	 f o r   ( v a r   i = 0 ;   i < l e n ;   i + + )   {  
 	 	 y t i c l a b e l s [ i ] = t h i s . u s e r y t i c l a b e l s [ i ] ;  
 	 } }  
  
 / /   D e t e r m i n e   r e q u i r e d   e x t r a   p a d d i n g   a n d   a u t o   a x i s   l o c a t i o n  
 	 t i c _ p t = N u m b e r ( ( t h i s . C S S t i c f o n t . s l i c e ( 0 , t h i s . C S S t i c f o n t . i n d e x O f ( " p t " ) ) ) . s l i c e ( - 2 ) ) ;  
 	 G Y L s t y l e + = t i c _ p t * ( y t i c c h a r n u m + 1 ) * 0 . 5 + " p t ; " ;  
 	 i f   ( y t i c l o c ! = " n o n e " )   {  
 	     i f   ( ! n u m x t i c l e f t )   {  
 	 	 i f   ( y t i c l o c = = " a u t o " )   { y t i c l o c = " l e f t " ; }  
 	 	 i f   ( y t i c l o c ! = " r i g h t " )   {  
 	 	 	 p a d _ l + = 0 . 7 5 * y t i c c h a r n u m * t i c _ p t * g x p t ;  
 	 	 	 i f   ( t h i s . y a x i s )   { p a d _ l + = 0 . 5 * t h i s . p a d _ l e f t * g x p t ; }  
 	 	 }  
 	     }  
 	     i f   ( n u m x t i c l e f t   = =   n u m x t i c - 1 )   {  
 	 	 i f   ( y t i c l o c = = " a u t o " )   { y t i c l o c = " r i g h t " ; }  
 	 	 i f   ( y t i c l o c ! = " l e f t " )   { p a d _ r + = 0 . 7 5 * y t i c c h a r n u m * t i c _ p t * g x p t ; }  
 	     }  
 	 }  
  
 	 i f   ( x t i c l o c ! = " n o n e " )   {  
 	     i f   ( ! n u m y t i c b o t )   {  
 	 	 i f   ( x t i c l o c = = " a u t o " )   { x t i c l o c = " b o t t o m " ; }  
 	 	 i f   ( x t i c l o c ! = " t o p " )   { p a d _ b + = 0 . 7 5 * t i c _ p t * g x p t ; }  
 	     }  
 	     i f   ( n u m y t i c b o t   = =   n u m y t i c - 1 )   {  
 	 	 i f   ( x t i c l o c = = " a u t o " )   { x t i c l o c = " t o p " ; }  
 	 	 i f   ( x t i c l o c ! = " b o t t o m " )   { p a d _ t + = 0 . 7 5 * t i c _ p t * g x p t ; }  
 	     }  
 	 i f   ( ! ( ( n u m x t i c l e f t   = =   n u m x t i c - 1 )   & &   ( y t i c l o c = = " r i g h t " ) ) )   { p a d _ r + = 0 . 2 5 * x t i c c h a r n u m l a s t * t i c _ p t * g x p t ; }  
 	 }  
 	 i f   ( t h i s . t i t l e )   {  
 	 	 t i t l e _ p t = N u m b e r ( ( t h i s . C S S t i t l e f o n t . s l i c e ( 0 , t h i s . C S S t i t l e f o n t . i n d e x O f ( " p t " ) ) ) . s l i c e ( - 2 ) ) ;  
 	 	 p a d _ t + = 1 . 2 5 * t i t l e _ p t * g x p t ;  
 	 	 i f   ( x t i c l o c = = " t o p " )   p a d _ t + = 0 . 7 5 * t i c _ p t * g x p t ; }  
 	 i f   ( t h i s . x a x i s )   {  
 	 	 x a x i s _ p t = N u m b e r ( ( t h i s . C S S x a x i s f o n t . s l i c e ( 0 , t h i s . C S S x a x i s f o n t . i n d e x O f ( " p t " ) ) ) . s l i c e ( - 2 ) ) ;  
 	 	 p a d _ b - = 0 . 2 5 * p a d _ b ;  
 	 	 p a d _ b + = x a x i s _ p t * g x p t ;  
 	 	 i f   ( x t i c l o c = = " b o t t o m " )   p a d _ b + = 0 . 7 5 * t i c _ p t * g x p t ; }  
 	 i f   ( t h i s . y a x i s )   {  
 	 	 y a x i s _ p t = N u m b e r ( ( t h i s . C S S y a x i s f o n t . s l i c e ( 0 , t h i s . C S S y a x i s f o n t . i n d e x O f ( " p t " ) ) ) . s l i c e ( - 2 ) ) ;  
 	 	 p a d _ l - = 0 . 2 5 * p a d _ l ;  
 	 	 p a d _ l + = y a x i s _ p t * g x p t ; }  
  
  
 	 g w = g w t - p a d _ l - p a d _ r ;  
 	 g h = g h t - p a d _ t - p a d _ b ;  
  
 	 x s c l = g w / ( x m a x - x m i n ) ;  
 	 y s c l = g h / ( y m a x - y m i n ) ;  
  
 	 t h i s . x m i n = x m i n ;    
 	 t h i s . x m a x = x m a x ;    
 	 t h i s . y m i n = y m i n ;    
 	 t h i s . y m a x = y m a x ;  
  
 	 g x m i n = p a d _ l ;  
 	 g x m a x = g w + p a d _ l ;  
 	 g x i n t = ( x i n t - x m i n ) * x s c l + p a d _ l ;  
 	 g y m i n = g h + p a d _ t ;  
 	 g y m a x = p a d _ t ;  
 	 g y i n t = ( y m a x - y i n t ) * y s c l + p a d _ t ;  
 	 g y t i c = y s c a l e * y s c l ;  
 	 g x t i c = x s c a l e * x s c l ;  
 	 g t i c s i z e = M a t h . a b s ( M a t h . r o u n d ( t i c s i z e * g x p t ) ) ;  
  
 	 g s t r = ' < v : g r o u p   s t y l e = " a n t i a l i a s : t r u e ;   w i d t h = ' + g w i d t h + ' p t ;   h e i g h t = ' + g h e i g h t + ' p t "   c o o r d s i z e = " ' + g w t + ' , ' + g h t + ' "   c o o r d o r i g i n = " 0 , 0 " > ' ;  
 	 g s t r + = ' < v : r e c t   s t y l e = " ' + g s t y l e + ' "   > < v : s t r o k e   ' + t h i s . V M L f r a m e s t r o k e + '   / > < v : f i l l   ' + t h i s . V M L b a c k g r o u n d f i l l + '   / > < / v : r e c t > ' ;  
  
 / /   d r a w   x - a x i s  
 	 i f ( x s c l ! = N u m b e r . P O S I T I V E _ I N F I N I T Y )   {  
 	 	 g s t r + = ' < v : l i n e   f r o m = " ' + g x m i n + ' , ' + M a t h . r o u n d ( g y i n t ) + ' "   t o = " ' + g x m a x + ' , ' + M a t h . r o u n d ( g y i n t ) + ' "   > < v : s t r o k e   ' + t h i s . V M L m a j o r a x i s s t r o k e + '   / > < / v : l i n e > ' ;  
 	 	 }  
 / /   d r a w   y - a x i s  
 	 i f ( y s c l ! = N u m b e r . P O S I T I V E _ I N F I N I T Y )   {  
 	 	 g s t r + = ' < v : l i n e   f r o m = " ' + M a t h . r o u n d ( g x i n t ) + ' , ' + g y m i n + ' "   t o = " ' + M a t h . r o u n d ( g x i n t ) + ' , ' + g y m a x + ' "   > < v : s t r o k e   ' + t h i s . V M L m a j o r a x i s s t r o k e + '   / > < / v : l i n e > ' ;  
 	 	 }  
 / /   d r a w   m i n o r   x - a x i s  
 	 y t i c m i n = g y i n t + n u m y t i c b o t * g y t i c ;  
 	 f o r   ( v a r   i = 0 ;   i < n u m y t i c ;   i + + )   {  
 	     c u r i n t = M a t h . r o u n d ( y t i c m i n - g y t i c * i ) ;  
 	     i f   ( c u r i n t ! = M a t h . r o u n d ( g y i n t ) )   { g s t r + = ' < v : l i n e   f r o m = " ' + g x m i n + ' , ' + c u r i n t + ' "   t o = " ' + g x m a x + ' , ' + c u r i n t + ' "   > < v : s t r o k e   ' + t h i s . V M L m i n o r x a x i s s t r o k e + '   / > < / v : l i n e > ' ; }  
 	 }  
  
 / /   d r a w   m i n o r   y - a x i s  
 	 x t i c m i n = g x i n t - n u m x t i c l e f t * g x t i c ;  
 	 f o r   ( v a r   i = 0 ;   i < n u m x t i c ;   i + + )   {  
 	     c u r i n t = M a t h . r o u n d ( g x t i c * i + x t i c m i n ) ;  
 	     i f   ( c u r i n t ! = M a t h . r o u n d ( g x i n t ) )   { g s t r + = ' < v : l i n e   f r o m = " ' + c u r i n t + ' , ' + g y m i n + ' "   t o = " ' + c u r i n t + ' , ' + g y m a x + ' "   > < v : s t r o k e   ' + t h i s . V M L m i n o r y a x i s s t r o k e + '   / > < / v : l i n e > ' ; }  
 	 }  
  
 / /   d r a w   x - a x i s   t i c s  
 	 g s t r + = ' < v : s h a p e   s t y l e = " ' + g s t y l e + ' " > < v : p a t h   v = " ' ;  
 	 f o r   ( v a r   i = 0 ;   i < n u m x t i c ;   i + + )   {   g s t r + = ' m   ' + M a t h . r o u n d ( x t i c m i n + i * g x t i c ) + ' , ' + M a t h . r o u n d ( g y i n t ) + '   r   0 , ' + ( ( x t i c l o c = = " t o p "   ?   - 1   :   1 ) * g t i c s i z e ) + '   x   ' ; }  
 	 g s t r + = ' e "   / > < v : s t r o k e   ' + t h i s . V M L m a j o r a x i s s t r o k e + '   / > < v : f i l l   o n = " f a l s e "   / > < / v : s h a p e > ' ;  
  
 / /   d r a w   y - a x i s   t i c s  
 	 g s t r + = ' < v : s h a p e   s t y l e = " ' + g s t y l e + ' " > < v : p a t h   v = " ' ;  
 	 f o r   ( v a r   i = 0 ;   i < n u m y t i c ;   i + + )   {   g s t r + = ' m   ' + M a t h . r o u n d ( g x i n t ) + ' , ' + M a t h . r o u n d ( y t i c m i n - i * g y t i c ) + '   r   ' + ( ( y t i c l o c = = " r i g h t "   ?   1   :   - 1 ) * g t i c s i z e ) + ' , 0   x   ' ; }  
 	 g s t r + = ' e "   / > < v : s t r o k e   ' + t h i s . V M L m a j o r a x i s s t r o k e + '   / > < v : f i l l   o n = " f a l s e "   / > < / v : s h a p e > ' ;  
  
 / /   d r a w   t i t l e s  
 	 i f   ( t h i s . t i t l e )   {  
 	 n o n c h a r = 0 ;    
 	 f o r   ( v a r   i = 0 ;   i < t h i s . t i t l e . l e n g t h ;   i + + )   { i f   ( t h i s . t i t l e . c h a r A t ( i ) = = " ; " )   { n o n c h a r + + ; } }  
 	 g s t r + = ' < s p a n   s t y l e = " ' + t h i s . C S S t i t l e f o n t + '   p o s i t i o n : a b s o l u t e ;   t e x t - a l i g n : c e n t e r ;   t o p :   ' + 0 . 5 * t h i s . p a d _ t o p ;  
 	 g s t r + = ' p t ;   l e f t :   ' + ( 0 . 5 * g w t / g x p t - ( t h i s . t i t l e . l e n g t h - 5 . 5 * n o n c h a r ) * t i t l e _ p t * 0 . 2 5 ) + ' p t ; " > ' + t h i s . t i t l e + ' < / s p a n > ' ;  
 	 }  
 	 i f   ( t h i s . x a x i s )   {  
 	 n o n c h a r = 0 ;    
 	 f o r   ( v a r   i = 0 ;   i < t h i s . x a x i s . l e n g t h ;   i + + )   { i f   ( t h i s . x a x i s . c h a r A t ( i ) = = " ; " )   { n o n c h a r + + ; } }  
 	 g s t r + = ' < s p a n   s t y l e = " ' + t h i s . C S S x a x i s f o n t + '   p o s i t i o n : a b s o l u t e ;   t e x t - a l i g n : c e n t e r ;   t o p :   ' + ( ( g y m i n + 0 . 5 * ( p a d _ b - x a x i s _ p t * g x p t ) ) / g x p t + ( x t i c l o c = = " b o t t o m "   ?   0 . 7 5 * t i c _ p t : 0 ) ) ;  
 	 g s t r + = ' p t ;   l e f t :   ' + ( 0 . 5 * g w t / g x p t - ( t h i s . x a x i s . l e n g t h - 5 . 5 * n o n c h a r ) * x a x i s _ p t * 0 . 2 5 ) + ' p t ; " > ' + t h i s . x a x i s + ' < / s p a n > ' ;  
 	 }  
 	 i f   ( t h i s . y a x i s )   {    
 	 g s t r + = ' < v : s h a p e   s t y l e = " ' + g s t y l e ;  
 	 g s t r + = ' "   p a t h = " M   ' + ( ( 0 . 2 5 * t h i s . p a d _ l e f t + 0 . 5 * y a x i s _ p t ) * g x p t ) + ' , ' + g y m i n + '   L   ' + ( ( 0 . 2 5 * t h i s . p a d _ l e f t + 0 . 5 * y a x i s _ p t ) * g x p t ) + ' , ' + g y m a x + ' "   f i l l c o l o r = " ' + t h i s . V M L y a x i s f o n t c o l o r + ' " > ' ;  
 	 g s t r + = ' < v : s t r o k e   o n = " f a l s e "   / > < v : p a t h   t e x t p a t h o k = " t r u e "   / > ' ;  
 	 g s t r + = ' < v : t e x t p a t h   o n = " t r u e "   s t y l e = " ' + t h i s . C S S y a x i s f o n t + ' "   s t r i n g = " ' + t h i s . y a x i s + ' "   / > < / v : s h a p e > ' ;  
 	 }  
  
 }   / /   e n d   o f   d r a w   g r a p h   b a c k g r o u n d  
  
  
 / /   h o l d   o n   t o   p r e v i o u s   p l o t  
     i f   ( t h i s . l a s t p l o t   ! =   " " )   {  
 	 g s t r = t h i s . l a s t p l o t . s u b s t r i n g ( 0 , t h i s . l a s t p l o t . l e n g t h - 1 0 ) ;  
 	 g s t r t e m p = g s t r ;  
     }  
  
 / /   d r a w   l i n e s  
     f o r   ( v a r   n = 0 ;   n < l i n e s . l e n g t h ;   n + + )   {  
     i f   ( l i n e s [ n ] . d r a w l i n e   & &   l i n e s [ n ] . x . l e n g t h > 1 )   {  
 	 g s t r + = ' < v : p o l y l i n e   p o i n t s = " ' ;  
 	 f o r   ( i = 0 ;   i < l i n e s [ n ] . x . l e n g t h ;   i + + )   { g s t r + =   M a t h . r o u n d ( g x m i n + ( l i n e s [ n ] . x [ i ] - x m i n ) * x s c l ) + "   " + M a t h . r o u n d ( g y m i n - ( l i n e s [ n ] . y [ i ] - y m i n ) * y s c l ) + "   " ; }  
 	 g s t r + = ' "   t i t l e = " ' + l i n e s [ n ] . l a b e l + ' "   > < v : s t r o k e   ' + l i n e s [ n ] . V M L s t r o k e + '   / > < v : f i l l   o n = " f a l s e "   / > < / v : p o l y l i n e > ' ;  
     } }  
  
  
 / /   d r a w   p o i n t s  
     f o r   ( v a r   n = 0 ;   n < l i n e s . l e n g t h ;   n + + )   {  
     i f   ( l i n e s [ n ] . d r a w p o i n t s   & &   l i n e s [ n ] . x . l e n g t h > 0 )   {  
 	 g s t r + = t h i s . V M L p o i n t s h a p e ( l i n e s [ n ] . V M L p o i n t s h a p e t y p e ) ;  
 	 f o r   ( i = 0 ;   i < l i n e s [ n ] . x . l e n g t h ;   i + + )   {  
 	 	 g s t r + = ' < v : s h a p e   t y p e = " # ' + ( l i n e s [ n ] . V M L p o i n t s h a p e t y p e ) . t o L o w e r C a s e ( ) + ' "   s t y l e = " w i d t h : ' + l i n e s [ n ] . p o i n t s i z e * g x p t + ' ;   h e i g h t : ' + l i n e s [ n ] . p o i n t s i z e * g x p t ;  
 	 	 g s t r + = ' ;   t o p : ' + M a t h . r o u n d ( g y m i n - 0 . 5 * l i n e s [ n ] . p o i n t s i z e * g x p t - ( l i n e s [ n ] . y [ i ] - y m i n ) * y s c l ) + ' ;   l e f t : ' + M a t h . r o u n d ( g x m i n - 0 . 5 * l i n e s [ n ] . p o i n t s i z e * g x p t + ( l i n e s [ n ] . x [ i ] - x m i n ) * x s c l ) ;  
 	 	 p t i t l e   =   ( l i n e s [ n ] . m o u s e o v e r l a b e l s )   ?   l i n e s [ n ] . l a b e l s [ i ]   :   ' 0?0F8B5B:   ' + l i n e s [ n ] . x [ i ] + '   M W ' +   ' \ n '   + ' &5=0:   ' + l i n e s [ n ] . y [ i ] + '   ¬ / M W h '   ;    
 	 	 g s t r + = ' "   t i t l e = " ' + p t i t l e + ' "   f i l l c o l o r = " ' + l i n e s [ n ] . p o i n t f i l l c o l o r + ' " ' ;  
 	 	 g s t r + = '   s t r o k e c o l o r = " ' + l i n e s [ n ] . p o i n t s t r o k e c o l o r + ' "   / > ' ;  
 	 }  
     } }  
  
 / /   d r a w   l a b e l s  
     f o r   ( v a r   n = 0 ;   n < l i n e s . l e n g t h ;   n + + )   {    
     i f   ( l i n e s [ n ] . d r a w l a b e l s   & &   l i n e s [ n ] . l a b e l s . l e n g t h > 0 )   {    
 	 f o r   ( i = 0 ;   i < l i n e s [ n ] . l a b e l s . l e n g t h ;   i + + )   {    
 	 	 g s t r + = ' < s p a n   s t y l e = " f o n t :   ' + l i n e s [ n ] . l a b e l s i z e + ' p t   ' + l i n e s [ n ] . l a b e l f o n t + ' ;   p o s i t i o n : a b s o l u t e ; ' ;  
 	 	 g s t r + = '   t o p : ' + M a t h . r o u n d ( ( g y m i n - 1 . 5 * l i n e s [ n ] . l a b e l s i z e * g x p t - ( l i n e s [ n ] . y [ i ] - y m i n ) * y s c l ) / g x p t ) + ' p t ;   l e f t : ' + M a t h . r o u n d ( ( g x m i n + 0 . 5 * l i n e s [ n ] . l a b e l s i z e * g x p t + ( l i n e s [ n ] . x [ i ] - x m i n ) * x s c l ) / g x p t ) + ' p t ;   ' ;  
 	 	 g s t r + = '   c o l o r : ' + l i n e s [ n ] . l a b e l c o l o r + ' " > ' + l i n e s [ n ] . l a b e l s [ i ] + ' < / s p a n > ' ;  
 	 }  
     } }  
  
 i f   ( t h i s . l a s t p l o t   = =   " " )   {   / /   d o n ' t   r e d r a w   g r a p h   b a c k g r o u n d   i f   c a l l e d   m u l t i p l e   t i m e s  
 / /   d r a w   x - a x i s   l a b e l s  
 	 i f   ( x t i c l o c ! = " n o n e " )   {  
 	 f o r   ( v a r   i = 0 ;   i < n u m x t i c ;   i + + )   {    
 	 	     i f   ( x t i c l o c = = " t o p " )   {  
 	 	 	 g s t r + = ' < s p a n   s t y l e = " ' + G X s t y l e + '   t o p :   ' + ( ( g y i n t - g t i c s i z e * 1 . 2 5 ) / g x p t - 8 ) + ' p t ;   l e f t :   ' + ( ( x t i c m i n + i * g x t i c - 0 . 5 * g t i c s i z e ) / g x p t ) + ' p t ; " > ' ;  
 	 	     }  
 	 	     e l s e   {  
 	 	 	 g s t r + = ' < s p a n   s t y l e = " ' + G X s t y l e + '   t o p :   ' + ( ( g y i n t + g t i c s i z e * 1 . 2 5 ) / g x p t ) + ' p t ;   l e f t :   ' + ( ( x t i c m i n + i * g x t i c - 0 . 5 * g t i c s i z e ) / g x p t ) + ' p t ; " > ' ;  
 	 	     }  
 	 	 g s t r + = x t i c l a b e l s [ i ] + ' < / s p a n > ' ;  
 	 } }  
  
 / /   d r a w   y - a x i s   l a b e l s  
 	 i f   ( y t i c l o c ! = " n o n e " )   {  
 	 f o r   ( v a r   i = 0 ;   i < n u m y t i c ;   i + + )   {    
 	 	     i f   ( y t i c l o c = = " r i g h t " )   {  
 	 	     	 g s t r + = ' < s p a n   s t y l e = " ' + G Y s t y l e + '   t o p :   ' + ( ( y t i c m i n - i * g y t i c - g t i c s i z e ) / g x p t ) + ' p t ;   l e f t :   ' + ( ( g x i n t + g t i c s i z e * 1 . 5 ) / g x p t ) + ' p t ; " > ' ;  
 	 	     }  
 	 	     e l s e   {  
 	 	     	 g s t r + = ' < s p a n   s t y l e = " ' + G Y L s t y l e + '   t o p :   ' + ( ( y t i c m i n - i * g y t i c - g t i c s i z e ) / g x p t ) + ' p t ;   l e f t :   ' + ( ( g x i n t - g t i c s i z e ) / g x p t - 0 . 5 * ( y t i c c h a r n u m + 1 ) * t i c _ p t ) + ' p t ; " > ' ;  
 	 	     }  
 	 	     g s t r + = y t i c l a b e l s [ i ] + ' < / s p a n > ' ;  
 	 } }  
 }   / /   e n d   o f   d r a w   g r a p h   b a c k g r o u n d  
  
 / /   c l o s e   a n d   r e t u r n   o u t p u t    
 	 g s t r + = ' < / v : g r o u p > ' ;  
     	 i f   ( t h i s . n u m p l o t s   >   0 )   { t h i s . l a s t p l o t a d d e d [ t h i s . n u m p l o t s ] = g s t r . l e n g t h - g s t r t e m p . l e n g t h ; }  
 	 e l s e   { t h i s . l a s t p l o t a d d e d [ 0 ] = g s t r . l e n g t h ; }  
 	 t h i s . n u m p l o t s + + ;  
 	 t h i s . l a s t p l o t = g s t r ;     / /   s a v e   t h i s   o u t p u t   i n   m e m o r y  
  
 	 r e t u r n   g s t r ;  
  
 }   / /   e n d   f u n c t i o n  
  
  
  
  
 / /   f u n c t i o n   t o   u n d o   l a s t   a d d e d   l i n e ,   l a b e l   o r   a r r o w   f r o m   t h e   p l o t  
  
 X Y G r a p h . p r o t o t y p e . D e l e t e L a s t   =   f u n c t i o n   ( )   {  
 	 i f   ( t h i s . n u m p l o t s   >   1 )   {  
 	 	 g s t r = t h i s . l a s t p l o t . s u b s t r i n g ( 0 , t h i s . l a s t p l o t . l e n g t h - t h i s . l a s t p l o t a d d e d [ t h i s . n u m p l o t s - 1 ] + 1 ) ;  
 	 	 g s t r + = ' < / v : g r o u p > ' ;  
 	 	 t h i s . l a s t p l o t = g s t r ;  
 	 	 t h i s . n u m p l o t s - - ;  
 	 }  
 	 r e t u r n   g s t r ;  
 }   / /   e n d   f u n c t i o n  
  
  
  
 X Y G r a p h . p r o t o t y p e . F i n d e d g e   =   f u n c t i o n   ( x 1 , x 2 , y 1 , y 2 , x m a x , x m i n , y m a x , y m i n )   {  
  
 	 x = 0 ;   y = 0 ;  
         i f   ( ! i s N a N ( x 2 ) )   {  
 	 i f   ( ! i s F i n i t e ( x 2 ) )   {  
 	 	 s w i t c h   ( x 2 )   {  
 	 	 	 c a s e   N u m b e r . P O S I T I V E _ I N F I N I T Y :   x 2   =   9 9 9 E + 9 9 ;   b r e a k ;  
 	 	 	 c a s e   N u m b e r . N E G A T I V E _ I N F I N I T Y :   x 2   =   - 9 9 9 E + 9 9 ;   b r e a k ;  
 	 	 }  
 	 }  
 	 i f   ( ! i s F i n i t e ( y 2 ) )   {  
 	 	 s w i t c h   ( y 2 )   {  
 	 	 	 c a s e   N u m b e r . P O S I T I V E _ I N F I N I T Y :   y 2   =   9 9 9 E + 9 9 ;   b r e a k ;  
 	 	 	 c a s e   N u m b e r . N E G A T I V E _ I N F I N I T Y :   y 2   =   - 9 9 9 E + 9 9 ;   b r e a k ;  
 	 	 }  
 	 }  
  
 	 a n g l e   =   M a t h . a t a n 2 ( y 2 - y 1 , x 2 - x 1 ) ;  
 	 a n g l e   + =   ( a n g l e   >   0   ?   0   :   2 * M a t h . P I ) ;  
  
 	 s l o p e   =   ( y 2 - y 1 ) / ( x 2 - x 1 ) ;  
 	 M x x   =   M a t h . a t a n 2 ( y m a x - y 1 , x m a x - x 1 ) ;   M x x   + =   ( M x x   >   0   ?   0   :   2 * M a t h . P I ) ;  
 	 M n x   =   M a t h . a t a n 2 ( y m a x - y 1 , x m i n - x 1 ) ;   M n x   + =   ( M n x   >   0   ?   0   :   2 * M a t h . P I ) ;  
 	 M n n   =   M a t h . a t a n 2 ( y m i n - y 1 , x m i n - x 1 ) ;   M n n   + =   ( M n n   >   0   ?   0   :   2 * M a t h . P I ) ;  
 	 M x n   =   M a t h . a t a n 2 ( y m i n - y 1 , x m a x - x 1 ) ;   M x n   + =   ( M x n   >   0   ?   0   :   2 * M a t h . P I ) ;  
  
 	 s w i t c h   ( t r u e )   {  
 	 	 c a s e   ( a n g l e > = M x x   & &   a n g l e < M n x )   :    
 	 	 	 y   =   y m a x ;  
 	 	 	 x   =   ( y m a x - y 1 ) / s l o p e + x 1 ;  
 	 	 	 b r e a k ;  
 	 	 c a s e   ( a n g l e > = M n x   & &   a n g l e < M n n )   :  
 	 	 	 x   =   x m i n ;  
 	 	 	 y   =   ( x m i n - x 1 ) * s l o p e + y 1 ;  
 	 	 	 b r e a k ;  
 	 	 c a s e   ( a n g l e > = M n n   & &   a n g l e < M x n )   :  
 	 	 	 y   =   y m i n ;  
 	 	 	 x   =   ( y m i n - y 1 ) / s l o p e + x 1 ;  
 	 	 	 b r e a k ;  
 	 	 c a s e   ( a n g l e > = M x n   | |   a n g l e < M x x )   :  
 	 	 	 x   =   x m a x ;  
 	 	 	 y   =   ( x m a x - x 1 ) * s l o p e + y 1 ;  
 	 	 	 b r e a k ;  
 	 }  
           }  
  
 	 r e t u r n   [ x , y ] ;    
 }   / /   e n d   f u n c t i o n  
  
  
  
 / /   p o i n t   s h a p e t y p e   d e f i n i t i o n s ,   t h e s e   c a n   b e   m o d i f i e d   a n d   e x p a n d e d  
  
 X Y G r a p h . p r o t o t y p e . V M L p o i n t s h a p e   =   f u n c t i o n   ( s h a p e n a m e )   {  
 	 s w i t c h   ( s h a p e n a m e . t o L o w e r C a s e ( ) )   {  
 	  
 	 c a s e   " d i a m o n d "   :  
 	 	 r e t u r n   ' < v : s h a p e t y p e   i d = " d i a m o n d "   c o o r d s i z e = " 5 0 0 , 5 0 0 "   p a t h = "   m   2 5 0   5 0 0   l   5 0 0   2 5 0   2 5 0   0   0   2 5 0   x   e "   / > ' ;  
 	 c a s e   " s q u a r e "   :  
 	 	 r e t u r n   ' < v : s h a p e t y p e   i d = " s q u a r e "   c o o r d s i z e = " 3 5 0 , 3 5 0 "   p a t h = "   m   0   0   l   0   3 5 0   3 5 0   3 5 0   3 5 0   0   x   e "   / > ' ;  
 	 c a s e   " t r i a n g l e "   :  
 	 	 r e t u r n   ' < v : s h a p e t y p e   i d = " t r i a n g l e "   c o o r d s i z e = " 4 0 0 , 4 0 0 "   p a t h = "   m   2 0 0   0   l   4 0 0   4 0 0   0   4 0 0   x   e "   / > ' ;  
 	 c a s e   " c i r c l e "   :  
 	 	 r e t u r n   ' < v : s h a p e t y p e   i d = " c i r c l e "   c o o r d s i z e = " 3 5 0 , 3 5 0 "   p a t h = "   m   0   1 7 5   l   2 3   2 6 2   8 8   3 2 7   1 7 5   3 5 0   2 6 2   3 2 7   3 2 7   2 6 2   3 5 0   1 7 5   3 2 7   8 8   2 6 2   2 3   1 7 5   0   8 8   2 3   2 3   8 8   x   e "   / > ' ;  
 	 c a s e   " x "   :  
 	 	 r e t u r n   ' < v : s h a p e t y p e   i d = " x "   c o o r d s i z e = " 3 5 0 , 3 5 0 "   p a t h = "   m   0   0   l   3 5 0   3 5 0   e   m   0   3 5 0   l   3 5 0   0   e "   / > ' ;  
 	 c a s e   " n o n e "   :  
 	 	 r e t u r n   ' < v : s h a p e t y p e   i d = " n o n e "   c o o r d s i z e = " 3 5 0 , 3 5 0 "   f i l l e d = " f a l s e "   s t r o k e d = " f a l s e "   p a t h = "   m   0   0   l   0   3 5 0   3 5 0   3 5 0   3 5 0   0   x   e "   / > ' ;  
 	 }  
 }   / /   e n d   f u n c t i o n  
  
  
  
 X Y G r a p h . p r o t o t y p e . D r a w a r r o w   =   f u n c t i o n   ( a r r o w d e f )   {  
  
 	 g s t r = g s t r . s u b s t r i n g ( 0 , g s t r . l e n g t h - 1 0 ) ;  
 	 g s t r t e m p = g s t r ;  
  
 	 a r r o w d e f . x   =   N u m b e r ( a r r o w d e f . x )  
 	 a r r o w d e f . y   =   N u m b e r ( a r r o w d e f . y )  
 	 a r r o w d e f . r o t a t i o n   =   N u m b e r ( a r r o w d e f . r o t a t i o n )  
 	 a r r o w d e f . l e n g t h   =   N u m b e r ( a r r o w d e f . l e n g t h )  
 	 a r r o w d e f . s i z e   =   N u m b e r ( a r r o w d e f . s i z e )  
  
 	 x p o i n t = M a t h . r o u n d ( g x m i n + ( a r r o w d e f . x - x m i n ) * x s c l + 0 . 5 * a r r o w d e f . s i z e * g x p t * M a t h . s i n ( a r r o w d e f . r o t a t i o n * M a t h . P I / 1 8 0 ) ) ;  
 	 y p o i n t = M a t h . r o u n d ( g y m i n - ( a r r o w d e f . y - y m i n ) * y s c l - 0 . 5 * a r r o w d e f . s i z e * g x p t * M a t h . c o s ( a r r o w d e f . r o t a t i o n * M a t h . P I / 1 8 0 ) ) ;  
  
 	 x p o i n t 2 = M a t h . r o u n d ( x p o i n t + a r r o w d e f . l e n g t h * g x p t * M a t h . s i n ( a r r o w d e f . r o t a t i o n * M a t h . P I / 1 8 0 ) ) ;  
 	 y p o i n t 2 = M a t h . r o u n d ( y p o i n t - a r r o w d e f . l e n g t h * g x p t * M a t h . c o s ( a r r o w d e f . r o t a t i o n * M a t h . P I / 1 8 0 ) ) ;  
  
 	 g s t r + = ' < v : l i n e   f r o m = " ' + x p o i n t + ' , ' + y p o i n t + ' "   t o = " ' + x p o i n t 2 + ' , ' + y p o i n t 2 + ' "   > < v : s t r o k e   w e i g h t = " ' + a r r o w d e f . l i n e w e i g h t + ' p t " ;   c o l o r = " ' + a r r o w d e f . c o l o r + ' " ;   d a s h s t y l e = " ' + a r r o w d e f . d a s h s t y l e + ' " ;   / > < / v : l i n e > ' ;  
  
 	 x p o i n t 3 = M a t h . r o u n d ( x p o i n t 2 + 1 . 2 5 * a r r o w d e f . l a b e l s i z e * g x p t * M a t h . s i n ( a r r o w d e f . r o t a t i o n * M a t h . P I / 1 8 0 ) ) ;  
 	 y p o i n t 3 = M a t h . r o u n d ( y p o i n t 2 - 1 . 2 5 * a r r o w d e f . l a b e l s i z e * g x p t ) ;  
  
 	 i f ( M a t h . c o s ( a r r o w d e f . r o t a t i o n * M a t h . P I / 1 8 0 ) > 0 . 7 0 7 )    
 	 	 { p o s i t i o n = '   t e x t - a l i g n : c e n t e r ;   t o p : ' + M a t h . r o u n d ( y p o i n t 3 / g x p t ) + ' p t ;   l e f t :   ' + M a t h . r o u n d ( x p o i n t 3 / g x p t - 0 . 2 5 * a r r o w d e f . l a b e l . l e n g t h * a r r o w d e f . l a b e l s i z e ) + ' p t ;   ' ; }  
 	 i f ( M a t h . c o s ( a r r o w d e f . r o t a t i o n * M a t h . P I / 1 8 0 ) < 0 . 7 0 7 )    
 	 	 { p o s i t i o n = '   t e x t - a l i g n : c e n t e r ;   t o p : ' + M a t h . r o u n d ( y p o i n t 2 / g x p t ) + ' p t ;   l e f t :   ' + M a t h . r o u n d ( x p o i n t 3 / g x p t - 0 . 2 5 * a r r o w d e f . l a b e l . l e n g t h * a r r o w d e f . l a b e l s i z e ) + ' p t ;   ' ; }  
 	 i f ( M a t h . s i n ( a r r o w d e f . r o t a t i o n * M a t h . P I / 1 8 0 ) > 0 . 7 0 7 )    
 	 	 { p o s i t i o n = '   t e x t - a l i g n : c e n t e r ;   t o p : ' + M a t h . r o u n d ( y p o i n t 2 / g x p t - a r r o w d e f . l a b e l s i z e * ( 0 . 5 + M a t h . c o s ( a r r o w d e f . r o t a t i o n * M a t h . P I / 1 8 0 ) ) ) + ' p t ;   l e f t :   ' + M a t h . r o u n d ( x p o i n t 3 / g x p t - 0 . 2 5 * a r r o w d e f . l a b e l . l e n g t h * a r r o w d e f . l a b e l s i z e ) + ' p t ;   ' ; }  
 	 i f ( M a t h . s i n ( a r r o w d e f . r o t a t i o n * M a t h . P I / 1 8 0 ) < 0 . 7 0 7 )    
 	 	 { p o s i t i o n = '   t e x t - a l i g n : c e n t e r ;   t o p : ' + M a t h . r o u n d ( y p o i n t 2 / g x p t - a r r o w d e f . l a b e l s i z e * ( 0 . 5 + M a t h . c o s ( a r r o w d e f . r o t a t i o n * M a t h . P I / 1 8 0 ) ) ) + ' p t ;   l e f t :   ' + M a t h . r o u n d ( x p o i n t 3 / g x p t - 0 . 2 5 * a r r o w d e f . l a b e l . l e n g t h * a r r o w d e f . l a b e l s i z e ) + ' p t ;   ' ; }  
  
 	 g s t r + = ' < s p a n   s t y l e = " f o n t :   ' + a r r o w d e f . l a b e l s i z e + ' p t   A r i a l ;   f o n t - w e i g h t : b o l d ;   p o s i t i o n : a b s o l u t e ; ' ;  
 	 g s t r + = p o s i t i o n + ' c o l o r : ' + a r r o w d e f . l a b e l c o l o r + ' " > ' + a r r o w d e f . l a b e l + ' < / s p a n > ' ;  
  
 	 x p o i n t = M a t h . r o u n d ( g x m i n - 0 . 5 * a r r o w d e f . s i z e * g x p t + ( a r r o w d e f . x - x m i n ) * x s c l + 0 . 5 * a r r o w d e f . s i z e * g x p t * M a t h . s i n ( a r r o w d e f . r o t a t i o n * M a t h . P I / 1 8 0 ) ) ;  
 	 y p o i n t = M a t h . r o u n d ( g y m i n - 0 . 5 * a r r o w d e f . s i z e * g x p t - ( a r r o w d e f . y - y m i n ) * y s c l - 0 . 5 * a r r o w d e f . s i z e * g x p t * M a t h . c o s ( a r r o w d e f . r o t a t i o n * M a t h . P I / 1 8 0 ) ) ;  
  
 	 g s t r + = a r r o w d e f . a r r o w h e a d ;  
 	 g s t r + = ' < v : s h a p e   t y p e = " # a r r o w h e a d "   s t y l e = " w i d t h : ' + a r r o w d e f . s i z e * g x p t + ' ;   h e i g h t : ' + a r r o w d e f . s i z e * g x p t ;  
 	 g s t r + = ' ;   t o p : ' + y p o i n t + ' ;   l e f t : ' + x p o i n t ;  
 	 g s t r + = ' "   t i t l e = " ' + a r r o w d e f . l a b e l + ' "   f i l l c o l o r = " ' + a r r o w d e f . c o l o r + ' " ' ;  
 	 g s t r + = ' " ;   s t y l e =   " r o t a t i o n : ' + a r r o w d e f . r o t a t i o n + ' d e g " ' ;  
 	 g s t r + = '   s t r o k e c o l o r = " ' + a r r o w d e f . c o l o r + ' "   / > ' ;  
 	  
 	 g s t r + = ' < / v : g r o u p > ' ;  
 	 t h i s . l a s t p l o t = g s t r ;  
 	 t h i s . l a s t p l o t a d d e d [ t h i s . n u m p l o t s ] = g s t r . l e n g t h - g s t r t e m p . l e n g t h ;  
 	 t h i s . n u m p l o t s + + ;  
 	 r e t u r n   g s t r ;  
  
 }   / /   e n d   f u n c t i o n  
  
  
  
 X Y G r a p h . p r o t o t y p e . D r a w l a b e l   =   f u n c t i o n   ( l a b e l d e f )   {  
  
 	 g s t r = g s t r . s u b s t r i n g ( 0 , g s t r . l e n g t h - 1 0 ) ;  
 	 g s t r t e m p = g s t r ;  
  
 	 l a b e l d e f . x   =   N u m b e r ( l a b e l d e f . x )  
 	 l a b e l d e f . y   =   N u m b e r ( l a b e l d e f . y )  
 	 l a b e l d e f . r o t a t i o n   =   N u m b e r ( l a b e l d e f . r o t a t i o n )  
 	 l a b e l d e f . l e n g t h   =   N u m b e r ( l a b e l d e f . l e n g t h )  
  
 	 x p o i n t = M a t h . r o u n d ( g x m i n + ( l a b e l d e f . x - x m i n ) * x s c l + 0 . 5 * l a b e l d e f . l a b e l s i z e * g x p t * M a t h . s i n ( l a b e l d e f . r o t a t i o n * M a t h . P I / 1 8 0 ) ) ;  
 	 y p o i n t = M a t h . r o u n d ( g y m i n - ( l a b e l d e f . y - y m i n ) * y s c l - 0 . 5 * l a b e l d e f . l a b e l s i z e * g x p t * M a t h . c o s ( l a b e l d e f . r o t a t i o n * M a t h . P I / 1 8 0 ) ) ;  
  
 	 x p o i n t 2 = M a t h . r o u n d ( x p o i n t + l a b e l d e f . l e n g t h * g x p t * M a t h . s i n ( l a b e l d e f . r o t a t i o n * M a t h . P I / 1 8 0 ) ) ;  
 	 y p o i n t 2 = M a t h . r o u n d ( y p o i n t - l a b e l d e f . l e n g t h * g x p t * M a t h . c o s ( l a b e l d e f . r o t a t i o n * M a t h . P I / 1 8 0 ) ) ;  
  
 	 x p o i n t 3 = M a t h . r o u n d ( x p o i n t 2 + 1 . 2 5 * l a b e l d e f . l a b e l s i z e * g x p t * M a t h . s i n ( l a b e l d e f . r o t a t i o n * M a t h . P I / 1 8 0 ) ) ;  
 	 y p o i n t 3 = M a t h . r o u n d ( y p o i n t 2 - 1 . 2 5 * l a b e l d e f . l a b e l s i z e * g x p t ) ;  
  
 	 i f ( M a t h . c o s ( l a b e l d e f . r o t a t i o n * M a t h . P I / 1 8 0 ) > 0 . 7 0 7 )    
 	 	 { p o s i t i o n = '   t e x t - a l i g n : c e n t e r ;   t o p : ' + M a t h . r o u n d ( y p o i n t 3 / g x p t ) + ' p t ;   l e f t :   ' + M a t h . r o u n d ( x p o i n t 3 / g x p t - 0 . 2 5 * l a b e l d e f . l a b e l . l e n g t h * l a b e l d e f . l a b e l s i z e ) + ' p t ;   ' ; }  
 	 i f ( M a t h . c o s ( l a b e l d e f . r o t a t i o n * M a t h . P I / 1 8 0 ) < 0 . 7 0 7 )    
 	 	 { p o s i t i o n = '   t e x t - a l i g n : c e n t e r ;   t o p : ' + M a t h . r o u n d ( y p o i n t 2 / g x p t ) + ' p t ;   l e f t :   ' + M a t h . r o u n d ( x p o i n t 3 / g x p t - 0 . 2 5 * l a b e l d e f . l a b e l . l e n g t h * l a b e l d e f . l a b e l s i z e ) + ' p t ;   ' ; }  
 	 i f ( M a t h . s i n ( l a b e l d e f . r o t a t i o n * M a t h . P I / 1 8 0 ) > 0 . 7 0 7 )    
 	 	 { p o s i t i o n = '   t e x t - a l i g n : c e n t e r ;   t o p : ' + M a t h . r o u n d ( y p o i n t 2 / g x p t - l a b e l d e f . l a b e l s i z e * ( 0 . 5 + M a t h . c o s ( l a b e l d e f . r o t a t i o n * M a t h . P I / 1 8 0 ) ) ) + ' p t ;   l e f t :   ' + M a t h . r o u n d ( x p o i n t 3 / g x p t - 0 . 2 5 * l a b e l d e f . l a b e l . l e n g t h * l a b e l d e f . l a b e l s i z e ) + ' p t ;   ' ; }  
 	 i f ( M a t h . s i n ( l a b e l d e f . r o t a t i o n * M a t h . P I / 1 8 0 ) < 0 . 7 0 7 )    
 	 	 { p o s i t i o n = '   t e x t - a l i g n : c e n t e r ;   t o p : ' + M a t h . r o u n d ( y p o i n t 2 / g x p t - l a b e l d e f . l a b e l s i z e * ( 0 . 5 + M a t h . c o s ( l a b e l d e f . r o t a t i o n * M a t h . P I / 1 8 0 ) ) ) + ' p t ;   l e f t :   ' + M a t h . r o u n d ( x p o i n t 3 / g x p t - 0 . 2 5 * l a b e l d e f . l a b e l . l e n g t h * l a b e l d e f . l a b e l s i z e ) + ' p t ;   ' ; }  
  
 	 g s t r + = ' < s p a n   s t y l e = " f o n t :   ' + l a b e l d e f . l a b e l s i z e + ' p t   A r i a l ;   f o n t - w e i g h t : b o l d ;   p o s i t i o n : a b s o l u t e ; ' ;  
 	 g s t r + = p o s i t i o n + ' c o l o r : ' + l a b e l d e f . l a b e l c o l o r + ' " > ' + l a b e l d e f . l a b e l + ' < / s p a n > ' ;  
  
 	 g s t r + = t h i s . V M L p o i n t s h a p e ( l a b e l d e f . V M L p o i n t s h a p e t y p e ) ;  
  
 	 g s t r + = ' < v : s h a p e   t y p e = " # ' + ( l a b e l d e f . V M L p o i n t s h a p e t y p e ) . t o L o w e r C a s e ( ) + ' "   s t y l e = " w i d t h : ' + l a b e l d e f . p o i n t s i z e * g x p t + ' ;   h e i g h t : ' + l a b e l d e f . p o i n t s i z e * g x p t ;  
 	 g s t r + = ' ;   t o p : ' + M a t h . r o u n d ( g y m i n - 0 . 5 * l a b e l d e f . p o i n t s i z e * g x p t - ( l a b e l d e f . y - y m i n ) * y s c l , 2 ) + ' ;   l e f t : ' + M a t h . r o u n d ( g x m i n - 0 . 5 * l a b e l d e f . p o i n t s i z e * g x p t + ( l a b e l d e f . x - x m i n ) * x s c l ) ;  
 	 g s t r + = ' "   f i l l c o l o r = " ' + l a b e l d e f . p o i n t f i l l c o l o r + ' " ' ;  
 	 g s t r + = '   s t r o k e c o l o r = " ' + l a b e l d e f . p o i n t s t r o k e c o l o r + ' "   / > ' ;  
  
 	 g s t r + = ' < / v : g r o u p > ' ;  
 	 t h i s . l a s t p l o t = g s t r ;  
 	 t h i s . l a s t p l o t a d d e d [ t h i s . n u m p l o t s ] = g s t r . l e n g t h - g s t r t e m p . l e n g t h ;  
 	 t h i s . n u m p l o t s + + ;  
 	 r e t u r n   g s t r ;  
  
 }   / /   e n d   f u n c t i o n  
  
  
  
  
  
  
  
 
