Learning Highcharts
Create rich, intuitive, and interactive JavaScript data visualization for your web and enterprise development needs using this powerful charting library — Highcharts
Joe Kuan
BIRMINGHAM - MUMBAI Learning Highcharts
Copyright © 2012 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.
First published: December 2012
Production Reference: 1131212
Published by Packt Publishing Ltd. Livery Place 35 Livery Street Birmingham B3 2PB, UK.
ISBN 978-1-84951-908-3 www . packtpub .com
Cover Image by Asher Wishkerman (wishkerman@hotmai l .com) Credits
Author Project Coordinator Joe Kuan Abhishek Kori
Reviewers Proofreader Torstein Hønsi Maria Gould Tomasz Nurkiewicz Gert Vaartjes Indexer Monica Ajmera Mehta
Acquisition Editor Kartikey Pandey Graphics Aditi Gajjar
Lead Technical Editor Ankita Shashi Production Coordinator Nilesh R. Mohite
Technical Editors Devdutt Kulkarni Cover Work Nilesh R. Mohite Ankita Meshram Pooja Pande
Copy Editors Aditya Nair
Foreword
Back in 2003, when I wanted to implement charts for my home page, Flash-based charting solutions were totally dominating the market. I resented the idea of meeting my nontechnical readers with a prompt to install a browser plugin just to view my content, so I went looking for other solutions. There were server-side libraries that produced a static chart image, but they didn't provide any form of interactivity. So I built a chart based on an image created dynamically on the server, overlaid with tool tips created in JavaScript. This still runs on my website and has survived the coming By 2006 all major browsers had support for vector graphics through either SVG or VML, so this seemed the way to go. I started working on Highcharts on weekends and vacations, and released it in 2009.
It was an instant success. Today, three years later, it has grown to become the preferred web charting engine by many, perhaps most, developers. Our bootstrapper company has nine persons working full time on developing, marketing, and selling Highcharts, and we have sold more than 22,000 licenses. Our clients include more than half of the 100 greatest companies in the world.
I was thrilled when Packt Publishing contacted me for reviewing this book. I soon realized that the author, Joe Kuan, has a tight grip on Highcharts, jQuery, and general JavaScript. He also does what I love the most to see from Highcharts what we even thought possible with our tool. All done step by step in increasingly complex examples.
I can't wait to recommend this book to our users.
Torstein Hønsi
CTO, Founder
Highsoft Solutions About the Author
Joe Kuan was born in Hong Kong and continued his education in the UK from secondary school to university. He studied Computer Science at University of Southampton for B.Sc. and Ph.D. After his education, he worked with different technologies and industries in the UK for more than a decade. Currently, he is working for iTrinegy – a company specializing in network emulation and performance monitoring. Part of his role is to develop frontend and present complex network data into stylish and interactive charts. He has adopted Highcharts with iTrinegy for nearly three years. Since then, he has been contributing blogs and software on Highcharts and Highstocks.
Apart from his busy family schedule and active outdoor lifestyle, he occasionally writes articles for his own blog site ht tp: / / joekuan . wordpress.com and puts some demonstrations up at ht tp: / / joekuan . org. You can contact him at learning . highchar ts@gmai l .com.
I hope this book has its place in the web publishing market. This book is like all technical books; they are nurtured by two teams of people—technical and personal. For the technical people, I am grateful to Packt Publishing for asking me to write this book—an opportunity that has never come to my mind and a valuable journey I will look back on. To the team of reviewers; Tomasz Nurkiewicz Torstein Hønsi and Gert Vaartjes for making sure of technical correctness, and Kartikey Pandey and Ankita Shashi for improving the readability. For the people whom I care about the most, I am thankful to my loving parents for showing me the importance of kindness and hard work in life, and my wife, for continual unconditional support and patience in helping me get this book sitting on a shelf. Finally, for my big little boy, Ivan:
"A thousand miles of journey, starts beneath the feet" – Lao Tzu About the Reviewers
Torstein Hønsi is a programmer and entrepreneur who has a passion for frontend developing and user interface design. He is the creator and lead developer of the Highcharts JavaScript library, and the CTO of Highsoft Solutions, the software company founded to manage Highcharts. Apart from work, he enjoys spending time with his family, preferably in the great outdoors of Norway.
Tomasz Nurkiewicz is a Java developer with six years of experience, typically working on the server side. He is also a Scala enthusiast. Currently, he is developing a track and trace system for Kezzler AS in Oslo, Norway. Tomasz strongly believes in the power of testing and automation. He claims that every functionality not tested automatically is not trustworthy and will eventually break.
Tomasz happily implements monitoring and data visualization solutions, hence his interest in client-side JavaScript charting libraries. He is also a technical blogger and blogs at ht tp: / /nurkiewicz. blogspot .com.
Gert Vaartjes started as a specialist in geographical information systems. While customizing these programs, he was intrigued by what's actually under the hood. Here started his passion for programming. This programming journey led him through all kinds of programming languages. As a technical consultant, he worked for several governmental and nongovernmental companies. He has been developing software for more than 10 years. Now he's working as a programmer at Highsoft Solutions, focusing on backend integration of the Highcharts product.