This article will show how to create a simple funnel 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 along with Intervals array

$p->data = array(array(
array('Heavy Industry', 12),
array('Retail', 9), 
array('Light Industry', 14), 
array('Out of home', 16),
array('Commuting', 7), 
array('Orientation', 9)
));

Step 3: Set Chart type

$p->chart_type = "funnel";

Step 4: Render Chart

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

For complete code, please visit live demo.

How useful was this post?

Click on a star to rate it!

Average rating 3.8 / 5. Vote count: 4

No votes so far! Be the first to rate this post.

As you found this post useful...

Follow us on social media!

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?