View unanswered posts | View active topics It is currently Fri Mar 29, 2024 8:00 am



Reply to topic  [ 1 post ] 
Min value of the Y axis 
Author Message
New pChart user
New pChart user

Joined: Tue Jul 31, 2012 11:24 am
Posts: 1
Post Min value of the Y axis
Hi I'd like the minimal value of the Y axis of my graph to be zero, but even though I use the START0 option in
the draw scale
$myPicture->drawScale($Data,$DataDescription,SCALE_START0,0,0,0);
my scale still begins with the -10 value.
Can someone help me out?


Code:
<?php
/* Include all the classes */
include("../../pChart2.1.3/class/pDraw.class.php");
include("../../pChart2.1.3/class/pImage.class.php");
include("../../pChart2.1.3/class/pData.class.php");



$url = "http://www.theverge.com/2012/7/30/3201879/htc-closing-south-korean-office";

/* Create your dataset object */

$myData = new pData();




/* Add data in your dataset */
$myData->addPoints(array(0.1,1,2,3,3),"Facebook Count");
$myData->addPoints(array(0.1,45,50,3,1),"Google Count");
$myData->addPoints(array(0,1,12,30,10),"LinkedIn Count");
$myData->addPoints(array(0,12,45,4,2),"Twitter Count");
$myData->setAxisName(0,"Social Interactions");


/* Create a pChart object and associate your dataset */
$myPicture = new pImage(700,230,$myData);

/* Choose a nice font */
$myPicture->setFontProperties(array("FontName"=>"C:\\WINDOWS\\Fonts\\SIMKAI.TTF","FontSize"=>8));


/* Define the boundaries of the graph area */
$myPicture->setGraphArea(60,40,670,190);

/* Draw the background */
$Settings = array("R"=>100, "G"=>100, "B"=>100, "Dash"=>0, "DashR"=>190, "DashG"=>203, "DashB"=>107);
$myPicture->drawFilledRectangle(0,0,700,230,$Settings);

/* Draw the scale, keep everything automatic */
$myPicture->drawScale($Data,$DataDescription,SCALE_START0,0,0,0); 

/* Draw the scale, keep everything automatic */
$myPicture->drawSplineChart();
   
/* Add a border to the picture */
$myPicture->drawRectangle(0,0,699,229,array("R"=>0,"G"=>0,"B"=>0));

$myPicture->setShadow(TRUE,array("X"=>1,"Y"=>1,"R"=>0,"G"=>0,"B"=>0,"Alpha"=>10));

/* Write the chart legend */
$myPicture->drawLegend(60,210,array("Style"=>LEGEND_NOBORDER,"Mode"=>LEGEND_HORIZONTAL));

/* Write the picture title */
$myPicture->setFontProperties(array("FontName"=>"C:\\WINDOWS\\Fonts\\SIMKAI.TTF","FontSize"=>10));
$myPicture->drawText(5,15,"Social interactions for article at url ",array("R"=>50,"G"=>0,"B"=>50));
$myPicture->drawText(15,30,$url,array("R"=>50,"G"=>0,"B"=>50));


/* Build the PNG file and send it to the web browser */
$myPicture->stroke();


?>


Tue Jul 31, 2012 1:52 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 1 post ] 

Who is online

Users browsing this forum: No registered users and 3 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