Book Image

Twilio Cookbook: Second Edition

By : Roger Stringer
Book Image

Twilio Cookbook: Second Edition

By: Roger Stringer

Overview of this book

Table of Contents (20 chapters)
Twilio Cookbook Second Edition
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Building a chart of responses


We've sent the survey and we've gotten responses; now we want to view results.

We create a chart of the responses we receive from our users; this is assembled onto a page. This handy page will let us see a nice chart of responses to see what people actually think.

We're also going to use the Highcharts PHP library to handle the chart. I like Highcharts because it's easy to customize and fits into any HTML page. The PHP library just helps make it quicker to set up.

Our survey reports will look like the following:

In this example, we've sent a survey that asks our subscribers what their favorite colors are and given them a choice of answers. Each answer is displayed beneath the question, along with the total number of replies for each. As you can see in this example, the color Purple was the most popular answer.

The Highcharts library does have other charts in its collection but I like this one because it puts everything right there for all to see.

Getting ready

The...