Dynamic Web Pages: deutschsprachiger PHP Knotenpunkt seit 1999

Dynamic Web Pages : tutorials _

 
  PHP Journal  


 
 
 

Offizieller
Konferenz-Partner


php|works & PyWorks 2008 Conference

PHP World Kongress
 


 
 
 
 

PHP QuickRef

Via QuickRef gelangen Sie direkt zur gesuchten Funktion im Handbuch.

 
 

Printmedien

PHP-Magazin
Das PHP Magazin erscheint 2-monatlich zum Preis von 9,80 €. Studenten erfreuen sich über ermäßigte Abos.

PHP-Journal
Das PHP Journal erscheint 2-monatlich zum Preis von 14,95 €. Studenten und Abonnenten erfreuen sich über bis zu 25% Ermäßigung.

PHP Solutions Magazin
Das PHP Solutions Magazin erscheint alle 3 Monate zum Preis von 8,75 €. Studenten erfreuen sich über ermäßigte Abos.

PHP-Architect
Der php|architect erscheint monatlich als digitale PDF-Version zum Preis von $3,99 USD und als Print-Version zum Preis von $8,69 USD. Im Abo gibt es Rabatt (30% Print, 15% PDF).

International PHP Magazine
Das international PHP Magazine erscheint monatlich zum Preis von 4,- € bzw. im Abo für 3,50 € (42,00 € /Jahresabo).

 
Dynamically Creating Graphs and Charts with PHP and GDChart

Dynamically Creating Graphs and Charts with PHP and GDChart (231)

If you've been working with PHP for a while, you already know that the language makes dynamic image generation very simple: the GD extension and a few lines of PHP code are all you need to create a JPEG, GIF or PNG image from scratch. However, while this works remarkably well for simple tasks, it can become tedious and complicated if you need to generate more complex images, such as graphs and charts, at run-time.



Take, for example, the task of turning a set of data values into a pie chart image. To arrive at the required result, you would need to allocate colors for each slice of the pie, calculate arc endpoints corresponding to the slice sizes, draw arcs and lines, fill each slice with a different color, write a descriptive text string and percentage value next to each slice, and render the final image. Completing the task might require between 80-100 lines of code and a few hours of debugging time...definitely not the most fun way to spend a Friday evening!



However, there's a simpler alternative: PHP's GDChart extension, which provides a full-featured API to efficiently generate charts and graphs. This extension, which is freely available from PECL, can significantly reduce the amount of work involved in dynamically generating graphical representations of numerical data at run-time. Over the next few pages, I'll introduce you to this extension, illustrating its important features and showing you just how easy it is to get your Friday evening back.

 


Tutorial kommentieren  Defekten Link melden

Kommentare zu diesem Tutorial
zurück

PHP Newsletter

Bleiben Sie immer "Up-To-Date" mit unseren Newslettern!

PHP Newsletter
PHP Trainingsletter

 
 
 
 

RSS-Feed

PHP News einbinden News von
Dynamic Web Pages
aktuell per RSS-Feed einbinden!

Mit der Einbindung des RSS-Feed erklären Sie sich mit den Nutzungsbedingungen einverstanden.

 
 
 
 

PHP Releases

 
 
 
 
 
   
powered by Hetzner


top Alle Rechte vorbehalten. © Dynamic Web Pages 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 top

  Seitenaufbau in 0.022 Sekunden  
 
Werbung an/aus Werbung aus Werbung an