This article will show how to create a simple donut 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('a',6), array('b',8), array('c',14), array('d',20)));
').'


Step 3: Set Chart type

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


Step 4: Render Chart

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


For complete code, please visit live demo.