Search icon
Subscription
0
Cart icon
Close icon
You have no products in your basket yet
Save more on your purchases!
Savings automatically calculated. No voucher code required
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Highcharts Essentials

You're reading from  Highcharts Essentials

Product type Book
Published in Oct 2014
Publisher
ISBN-13 9781783983964
Pages 228 pages
Edition 1st Edition
Languages
Author (1):
Bilal Shahid Bilal Shahid
Profile icon Bilal Shahid

Table of Contents (16) Chapters

Highcharts Essentials
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
1. Getting Started with Highcharts 2. Column and Bar Charts 3. Line and Spline Charts 4. Area, Scatter, and Bubble Charts 5. Pie, Polar, and Spider Web Charts 6. Other Chart Types 7. Theming with Highcharts 8. Exploring Highcharts APIs and Events 9. Going Further with Highcharts Index

Creating line charts with multiple series


We can also create a line chart with multiple series just as we did with column charts in the previous chapter. We will also include the conversion rates of GBP in our chart along with USD and Euro.

Copy the code from the previous example and add a series for GBP:

{
  name: 'GBP',
  data: [
    [Date.UTC(2013, 08, 01), 1.5835],
    [Date.UTC(2013, 09, 01), 1.6092],
    [Date.UTC(2013, 10, 01), 1.6088],
    [Date.UTC(2013, 11, 01), 1.6368],
    [Date.UTC(2014, 00, 01), 1.6468],
    [Date.UTC(2014, 01, 01), 1.6546],
    [Date.UTC(2014, 02, 01), 1.6629]
  ]
}

Refresh the page and the series for GBP will now be included in the chart.

There is one problem though: if you hover over any data point of the GBP series, the tooltip will keep mentioning Euro instead of GBP:

This is because we hardcoded the series name as Euro in our tooltip's formatter() method. Change it to the following and the tooltip will start working correctly:

formatter: function() {
  var...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}