Login Register Wishes Forum About
Sample scripts » Drawing objets
Help topics
Latest updates
2209d  replaceImageMapTitle
2209d  replaceImageMapValues
2209d  createFunctionSerie
2209d  setAbsicssaPosition
2209d  negateValues
  Download as PDF
  Print this page
  Share this page
  Create an account
  Feed the updates!
Google AdSense
Drawing object - An introduction to this library

pChart is providing many "basic" drawing function that will allow you to enhance the rendering of your images. All the internal drawing functions are using the anti-aliasing algorithm to provide the best ‘look-n-feel‘ experience for your users.

Sample script

The sample below will show you the way to create rich & nice looking charts background starting from scratch with a blank area. By going through this documentation you‘ll see that the pChart library provide a number of functions to add rich contents to your outputs. Rendering quality has always been the key axis of improvements.

 /* pChart library inclusions */

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

 /* Define default font settings */

 /* Create the background */
 $RectangleSettings = array("R"=>181,"G"=>209,"B"=>27,"Alpha"=>100);

 /* Enable shadow computing on a (+1,+1) basis */

 /* Draw the left area */
 $RectangleSettings = array("R"=>181,"G"=>209,"B"=>27,"Alpha"=>100);
 $TextSettings = array("R"=>255,"G"=>255,"B"=>255,"Angle"=>90,"Align"=>TEXT_ALIGN_MIDDLELEFT); 
 $myPicture->drawText(10,220,"My first chart",$TextSettings);

 /* Draw the right area */
 $RectangleSettings = array("R"=>191,"G"=>219,"B"=>37,"Alpha"=>100,"Surrounding"=>20,"Ticks"=>2);

 /* Write the legend */
 $TextSettings = array("R"=>255,"G"=>255,"B"=>255,"Align"=>TEXT_ALIGN_MIDDLEMIDDLE); 
 $myPicture->drawText(600,30,"Weather data",$TextSettings);
 $TextSettings = array("R"=>106,"G"=>125,"B"=>3,"Align"=>TEXT_ALIGN_TOPLEFT,"FontSize"=>11); 
 $myPicture->drawText(520,45,"The   data  shown  here   has   been",$TextSettings);
 $myPicture->drawText(520,60,"collected from European locations",$TextSettings);
 $myPicture->drawText(520,75,"by the French NAVI system.",$TextSettings);

 /* Disable shadow computing  */

 /* Draw the picture border */
 $RectangleSettings = array("R"=>181,"G"=>209,"B"=>27,"Alpha"=>100);

 /* Render the picture */
Last updated on 06/02/2010 
by Jean-Damien 
Linked resources
  There is no linked topic yet.
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. 409 users have registered. This page has been rendered in 0,01 seconds. Wiki revision 1.37.