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



Reply to topic  [ 4 posts ] 
Radar Charts 
Author Message
pChart user
pChart user

Joined: Wed Jan 05, 2011 4:48 pm
Posts: 4
Location: France
Post Radar Charts
Hi again :D

I noticed another minor bug on radar charts, and it's visible in my first post too ^^
The color of the axis changes :

Image

In the bottom-right corner (in fact on the part with the labels), the color is darker than on the rest of the chart.

I don't know if it's on purpose or not ^^

Here is a code for a radar chart :
Code:
$etiquettes = array('1','2','3','4');
// $etiquettes2 = array('1','2','3','4','5');

$valeurs = array('Serie 1', array(1,2,1,2));
// $valeurs2 = array('Serie 1', array(1,2,1,2,1));

$titre = 'Titre';

$MyData = new pData();

$MyData->addPoints($valeurs[1],"Serie1");
$MyData->setSerieDescription("Serie1",$valeurs[0]);
// $MyData->addPoints($valeurs2[1],"Serie1");
// $MyData->setSerieDescription("Serie1",$valeurs2[0]);

/* Définition des noms de branches */
$MyData->addPoints($etiquettes,"Labels");
// $MyData->addPoints($etiquettes2,"Labels");
$MyData->setAbscissa("Labels");

/* Création de l'objet pChart */
$myPicture = new pImage(400,350,$MyData);
$RectangleSettings = array("R"=>180,"G"=>180,"B"=>180,"Alpha"=>100);

/* Titre du graph */
$myPicture->setFontProperties(array("FontName"=>"./pChart2/fonts/verdana.ttf","FontSize"=>10));
$myPicture->drawText(195,20,$titre,array("R"=>100,"G"=>100,"B"=>100,"Align"=>TEXT_ALIGN_MIDDLEMIDDLE));
$myPicture->drawRoundedRectangle(5,5,395,40,5,array("R"=>100,"G"=>100,"B"=>100));

/* Définition de la police par défaut */
$myPicture->setFontProperties(array("FontName"=>"./pChart2/fonts/verdana.ttf","FontSize"=>9,"R"=>80,"G"=>80,"B"=>80));

/* Création de l'objet pRadar */
$SplitChart = new pRadar();

/* Dessin du graph radar */
$myPicture->setGraphArea(10,50,390,310);
$Options = array("SegmentHeight"=>1,"Segments"=>5,"DrawPoly"=>true,"DrawPoints"=>false,"Layout"=>RADAR_LAYOUT_STAR,"LabelsBGR"=>240,"LabelsBGG"=>240,"LabelsBGB"=>240,"LabelPos"=>RADAR_LABELS_HORIZONTAL,"BackgroundGradient"=>array("StartR"=>255,"StartG"=>255,"StartB"=>255,"StartAlpha"=>100,"EndR"=>235,"EndG"=>235,"EndB"=>235,"EndAlpha"=>20));
$SplitChart->drawRadar($myPicture,$MyData,$Options);

/* Sortie du graph (fichier) */
$myPicture->Render('radar.png');

If you have a solution... Again :D

Thanks ! :D

_________________
Sorry for my english :D


Tue Jan 25, 2011 3:58 pm
Profile
Site Admin
Site Admin
User avatar

Joined: Thu Dec 02, 2010 2:31 pm
Posts: 409
Location: France
Post Re: Radar Charts
You're right, there is an issue here ;o) The patch is included below. --this is added to the 2.1.0 that will be published today or tomorrow.

Line 200 of the pRadar.class file :

Replace :
Code:
         for($i=0;$i<=360;$i=$i+(360/$Points))

by
Code:
         for($i=0;$i<360;$i=$i+(360/$Points))


Line 259 of the pRadar.class file :

Replace :
Code:
     for($i=0;$i<=360;$i=$i+(360/$Points))

by
Code:
     for($i=0;$i<360;$i=$i+(360/$Points))


Tue Jan 25, 2011 4:59 pm
Profile WWW
pChart user
pChart user

Joined: Wed Jan 05, 2011 4:48 pm
Posts: 4
Location: France
Post Re: Radar Charts
Thanks a lot ! :)

_________________
Sorry for my english :D


Wed Jan 26, 2011 9:20 am
Profile
Site Admin
Site Admin
User avatar

Joined: Thu Dec 02, 2010 2:31 pm
Posts: 409
Location: France
Post Re: Radar Charts
This has been fixed in the 2.1.0 that you can get from here : download.

Kind regards,
JD.


Wed Jan 26, 2011 3:00 pm
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 4 posts ] 

Who is online

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