Creating an Area Chart using PHP

Creating an Area Chart using PHP

This article will show how to create a simple area chart using Charts 4 PHP Framework.

Step 1: Include Charts 4 PHP Library

include("../../lib/inc/chartphp_dist.php");
$p = new chartphp();

Step 2: Configure Data array

$p->data = array(array(3,7,9,1,4,6,8,2,5),array(5,3,8,2,6,2,9,2,6));

Step 3: Set Chart type

$p->chart_type = "area";

Step 4: Render Chart

$out = $p->render("c1");

For complete code, please visit live demo.