Ignore:
Timestamp:
Sep 28, 2010, 7:34:40 PM (11 years ago)
Author:
goya
Message:

graphe d'accueil

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpc/trunk/project/plugins/xsPChartPlugin/lib/pChart/pChart/pChart.class

    r1439 r1472  
    290290
    291291   /* Compute and draw the scale */
    292    function drawScale(&$Data,&$DataDescription,$ScaleMode,$R,$G,$B,$DrawTicks=TRUE,$Angle=0,$Decimals=1,$WithMargin=FALSE,$SkipLabels=1)
     292   function drawScale(&$Data,&$DataDescription,$ScaleMode,$R,$G,$B,$DrawTicks=TRUE,$Angle=0,$Decimals=1,$WithMargin=FALSE,$SkipLabels=1,$TopAxis=FALSE)
    293293    {
    294294     /* Validate the Data and DataDescription array */
     
    298298
    299299     $this->drawLine($this->GArea_X1,$this->GArea_Y1,$this->GArea_X1,$this->GArea_Y2,$R,$G,$B);
    300      $this->drawLine($this->GArea_X1,$this->GArea_Y2,$this->GArea_X2,$this->GArea_Y2,$R,$G,$B);
     300     if ($TopAxis == FALSE)
     301       $this->drawLine($this->GArea_X1,$this->GArea_Y2,$this->GArea_X2,$this->GArea_Y2,$R,$G,$B);
     302     else $this->drawLine($this->GArea_X1,$this->GArea_Y1,$this->GArea_X2,$this->GArea_Y1,$R,$G,$B);
    301303
    302304     if ( $this->VMin == NULL && $this->VMax == NULL)
     
    467469     $XPos = $this->GArea_X1 + $this->GAreaXOffset;
    468470     $ID = 1; $YMax = NULL;
     471     if ($TopAxis == FALSE) {
     472      $YAxisPos = $this->GArea_Y2;
     473      $YAxisOrt = 1;
     474      $YLegShift = 10;
     475     } else {
     476      $YAxisPos = $this->GArea_Y1;
     477      $YAxisOrt = -1;
     478      $YLegShift = 7;
     479     }
    469480     foreach ( $Data as $Key => $Values )
    470481      {
    471482       if ( $ID % $SkipLabels == 0 )
    472483        {
    473          $this->drawLine(floor($XPos),$this->GArea_Y2,floor($XPos),$this->GArea_Y2+5,$R,$G,$B);
     484         $this->drawLine(floor($XPos),$YAxisPos,floor($XPos),$YAxisPos+$YAxisOrt*5,$R,$G,$B);
    474485         $Value      = $Data[$Key][$DataDescription["Position"]];
    475486         if ( $DataDescription["Format"]["X"] == "number" )
     
    488499         if ( $Angle == 0 )
    489500          {
    490            $YPos = $this->GArea_Y2+18;
     501           $YPos = $YAxisPos+$YAxisOrt*18;
    491502           imagettftext($this->Picture,$this->FontSize,$Angle,floor($XPos)-floor($TextWidth/2),$YPos,$C_TextColor,$this->FontName,$Value);
    492503          }
    493504         else
    494505          {
    495            $YPos = $this->GArea_Y2+10+$TextHeight;
     506           $YPos = $YAxisPos+$YLegShift+$YAxisOrt*($TextHeight);
    496507           if ( $Angle <= 90 )
    497             imagettftext($this->Picture,$this->FontSize,$Angle,floor($XPos)-$TextWidth+5,$YPos,$C_TextColor,$this->FontName,$Value);
     508            imagettftext($this->Picture,$this->FontSize,$Angle,floor($XPos)-$TextWidth/2+5,$YPos,$C_TextColor,$this->FontName,$Value);
    498509           else
    499510            imagettftext($this->Picture,$this->FontSize,$Angle,floor($XPos)+$TextWidth+5,$YPos,$C_TextColor,$this->FontName,$Value);
Note: See TracChangeset for help on using the changeset viewer.