View unanswered posts | View active topics It is currently Sun Apr 28, 2024 7:02 pm



Reply to topic  [ 3 posts ] 
histogram and drawFilledStepChart 
Author Message
New pChart user
New pChart user

Joined: Thu Jun 21, 2012 12:08 pm
Posts: 2
Post histogram and drawFilledStepChart
Hello

I Determined the 10 intervals and have calculated values for each interval. The problem is that the labels that are the beginnings of the intervals are in the middle instead of left. This is shown in the attached image. I will be grateful for your help.


Attachments:
File comment: histogram using drawFilledStepChart
chart_problem.jpg
chart_problem.jpg [ 17.38 KiB | Viewed 6055 times ]
Thu Jun 21, 2012 12:27 pm
Profile
Experienced pChart user
Experienced pChart user

Joined: Tue Aug 02, 2011 11:49 pm
Posts: 34
Post Re: histogram and drawFilledStepChart
without any code it is not possible to help you
perhaps causes the LabelRotation the shifting
the axis origin and the abscissa origin are not congruent (the shifting matches exact the distance between the zeros)


Thu Jun 21, 2012 10:13 pm
Profile
New pChart user
New pChart user

Joined: Thu Jun 21, 2012 12:08 pm
Posts: 2
Post Re: histogram and drawFilledStepChart
ok, this is my simplified code:


Code:
public static function test()
   {
      $MyData = new pData(); 
      
       //data for intervals 0-10,10-20,20-30 ... 100-x
       $MyData->addPoints(array(0,0,10,12,9,6,4,1,0,0,VOID),"Data");
      
       $MyData->setAxisName(0,"Data");
       $MyData->addPoints(array('0','10','20','30','40','50','60','70','80','90','100'),"Intervals1");
       $MyData->setSerieDescription("Intervals1","Intervals");
       $MyData->setAbscissa("Intervals1");
      $MyData->setAbscissaName("Intervals");
       /* Create the pChart object */
       $myPicture = new pImage(700,230,$MyData);
      
       /* Turn of AAliasing */
       $myPicture->Antialias = FALSE;
      
       /* Draw the border */
       $myPicture->drawRectangle(0,0,699,229,array("R"=>0,"G"=>0,"B"=>0));
      
       $myPicture->setFontProperties(array("FontName"=> sfConfig::get('sf_lib_dir')."/pchart/fonts/".self::$fontname,"FontSize"=>10));
      
       /* Define the chart area */
       $myPicture->setGraphArea(60,30,650,190);
      
       /* Draw the scale */
       $scaleSettings = array("XMargin"=>0,"YMargin"=>0, "Mode" => SCALE_MODE_START0);
       $myPicture->drawScale($scaleSettings);
      
       /* Draw the step chart */
       $myPicture->drawFilledStepChart();       
      
       /* Render the picture (choose the best way) */
      
       $filename = 'histogram'.time().'.png';
       $myPicture->render(self::getUploadsDir('/').$filename);
       self::echoImageTag($filename, 700, 230);    
   }


Attachments:
File comment: Chart I get
wykres1.jpg
wykres1.jpg [ 29.6 KiB | Viewed 6036 times ]
File comment: Chart I need
wykres2.jpg
wykres2.jpg [ 23.08 KiB | Viewed 6036 times ]
Fri Jun 22, 2012 11:38 am
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 3 posts ] 

Who is online

Users browsing this forum: Bing [Bot] and 27 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron