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 : Gottreu
5 (1)
close
close
Learning jqPlot

Learning jqPlot

5 (1)
By: 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

Adding extra canvas elements

Our overlayLogo function will calculate the new height and position for our logo. Then, we will use the drawImage method to convert the image and make it part of the main canvas. We wrap all of this in a setInterval function because we have to wait for jqPlot to render all the canvas elements before we can add our image. Perform the following steps to add extra canvas elements:

  1. We start by setting yPos to bottom if nothing is passed in for this parameter. When calculating coordinates for a canvas element, we begin at the upper-left corner. So, we declare variables for our height and the x and y coordinates. Next, we create a variable to hold our setInterval function as follows:
    function overlayLogo(id, scaledWidth, yPos) {
      if(typeof(yPos) === 'undefined') { yPos = 'bottom' };
      var height = 0, top = 0, left = 0, canvas = '';
      var checkCanvas = setInterval(function() {
  2. jqPlot does not add an ID to the canvas elements it creates,...
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