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

Step 1: Include Charts 4 PHP Library

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


Step 2: Configure Data array

'.wch_stripslashes('$p->data = array(array(
array("2010/10",48.25),
array("2011/01",238.75),
array("2011/02",95.50),
array("2011/03",300.50),
array("2011/04",286.80),
array("2011/05",400)
));
').'


Step 3: Set Chart type

'.wch_stripslashes('$p->chart_type = "bar";
').'


Step 4: Render Chart

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


For complete code, please visit live demo.