Login Register Wishes Forum About
Language Reference » Spring charts functions » addNode
Help topics
Latest updates
4640d  replaceImageMapTitle
4640d  replaceImageMapValues
4640d  createFunctionSerie
4640d  setAbsicssaPosition
4640d  negateValues
  Download as PDF
  Print this page
  Share this page
  Create an account
  Feed the updates!
Google AdSense
addNode - Add a node

This function allows you to add a new node and its relations with the other nodes. You can definin the node properties like color, shape,.. to all of them. Parameters are given trough a $Settings array. To learn more about this please read the Format array guide.

Calling this function

$NodeID will be the unique ID of the node. We recommend to use numbers.

Settings array - Tune up your node!

It is possible to specify the following settings with this array.

Node name can be set with Name.
Node color can be set with R, G, B.
Node border color can be set with BorderR, BorderG, BorderB.
Surrounding color can be set with Surrounding.
Label background color can be set with BackgroundR,BackgroundRG,BackgroundB.
Shape can be set with Shape. (see below)
Size can be set with Shape.
Free zone can be set with FreeZone.
Nodes connections must be given in Connections.

The connections can be given as an array of IDs if they are multiple or with a single ID if there is online one.

Following shapes types are allowed :

NODE_SHAPE_CIRCLE, this will draw circular nodes.
NODE_SHAPE_SQUARE, this will draw box nodes.
NODE_SHAPE_TRIANGLE, this will draw triangular nodes.

Sample script

 /* pChart library inclusions */

 /* Create the pChart object */
 $myPicture = new pImage(300,300);

 /* Create the background */
 $myPicture->drawText(10,13,"pSpring - Draw spring charts",array("R"=>255,"G"=>255,"B"=>255));

 /* Define the charting area & stuff */

 /* Create the pSpring object */
 $SpringChart = new pSpring();

 /* Create some nodes & relations */

 /* Define the nodes color */

 /* Customize some relations */

 /* Render the spring chart */
 $Result = $SpringChart->drawSpring($myPicture);

 /* Render the picture */
Last updated on 07/22/2010 
by Jean-Damien 
Linked resources
Community comments
  No comments have been posted yet.
© Copyrights
Components used on this web site : Famfamfam icons has been made by Mark James, Rounded corners lite has been coded by Cameron Cooke and Tim Hutchison, SyntaxHighlighter has been written by Alex Gorbatchev. pChart and this web site have been created by Jean-Damien POGOLOTTI. This documentation contains 185 pages and 56 comments. 415 users have registered. This page has been rendered in 0,01 seconds. Wiki revision 1.37.