Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying Learning jqPlot
  • Table Of Contents Toc
Learning jqPlot

Learning jqPlot

By : Scott Gottreu
5 (1)
close
close
Learning jqPlot

Learning jqPlot

5 (1)
By: Scott Gottreu

Overview of this book

If you are a developer with a good understanding of JavaScript and jQuery and have been burdened with the task of analyzing and presenting some data, this book will provide you with the start you need to create some very attractive data visualizations.
Table of Contents (14 chapters)
close
close
13
Index

Modifying the data array and the tooltip


In order to remedy this problem, we need the closing price to be the first y value in our data array. We can accomplish this by modifying our dataPull function. We save the previous code as a new file and start making our changes executing the following steps:

  1. We create a new array called stocks, and then loop through the remoteData array. We add the date, which is the first element, and then we add the closing price, which is the last element in the remoteData array:

    ...
      function dataPull(remoteData,options) {
        var stocks = new Array;
        for(var x=0;x<remoteData.length;x++){
          stocks[x] = new Array;
          stocks[x].push(remoteData[x][0],remoteData[x][4]);
  2. We now have our x and y values, so we loop through the rest of the prices in the child array. Once we finish working through remoteData, we return our new array to jqPlot:

          for(var y=1;y<remoteData[x].length;y++){
            stocks[x].push(remoteData[x][y]);
          }
        }
        return...
CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
Learning jqPlot
notes
bookmark Notes and Bookmarks search Search in title playlist Add to playlist font-size Font size

Change the font size

margin-width Margin width

Change margin width

day-mode Day/Sepia/Night Modes

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY

Submit Your Feedback

Modal Close icon
Modal Close icon
Modal Close icon