Book Image

HTML5 Graphing and Data Visualization Cookbook

By : Ben Fhala
Book Image

HTML5 Graphing and Data Visualization Cookbook

By: Ben Fhala

Overview of this book

The HTML5 canvas tag makes creating any plot shape easy, all you have to do then is fill it with exciting visualizations written in JavaScript or using other visualization tools. "HTML5 Graphing and Data Visualization Cookbook" is the perfect break into the world of Canvas, charts, and graphs in HTML5 and JavaScript. In this book we will go through a journey of getting to know the technology by creating and planning data-driven visualizations. This cookbook is organized in a linear, progressive way so it can be read from start to finish, as well as be used as a resource for specific tasks.This book travels through the steps involved in creating a fully interactive and animated visualization in HTML5 and JavaScript. You will start from very simple "hello world"ù samples and quickly dive deeper into the world of graphs and charts in HTML5. Followed by learning how canvas works and carrying out a group of tasks geared at taking what we learned and implementing it in a variety of chart types. With each chapter the content becomes more complex and our creations become more engaging and interactive.Our goal is that by the end of this book you will have a strong foundation; knowing when to create a chart on your own from scratch and when it would be a good idea to depend on other APIs.We finish our book in our last two chapters exploring Google maps and integrating everything we learnt into a full project.
Table of Contents (17 chapters)
HTML5 Graphing and Data Visualization Cookbook
Credits
About the Author
About the Reviewer
www.PacktPub.com
Preface
Index

Building a clock with RaphaelJS


Hands down this is my favorite sample in this chapter. It's based on a mix of two samples on Raphael's website (I strongly encourage you to explore it). Although Raphael isn't a graphing library, it's a really powerful animation and drawing library that is really worth playing with.

In this recipe, we will create a clock that is creative (I think). I planned to play with this library for a day or two, and ended up playing with it all weekend as I was just having so much fun. I ended up with a digit morphing clock (based on a sample that Raphael created on his site for letter morphing) and incorporated some arcing into it based on the polar clock example on his site. Let's see it in action:

Getting ready

As always in this chapter, you need the original library of Raphael. I've added it into our project. So just download the files and let's get rolling.

To grab the original library, visit our external source files hub for this chapter at http://blog.everythingfla...