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 a fill between two lines


We talk through Calvin's comments. Adding in expenses won't be too much of an issue. We could simply add the expense line to one of our existing reports but that will likely not be what they want. Visually, the gap on our chart between profit and revenue should be the total amount of expenses. You mention that we could fill in the gap between the two lines. We decide to give this a try:

  1. We leave the plugins and the data arrays alone. We pass an empty array into our data array as a placeholder for our expenses. Next, we update our title. After this, we add a new series object and label it Expenses:

    ...
        var rev_profit = $.jqplot ('revPrfChart', [revenue, profit, []],
        {
          title:'Monthly Revenue & Profit with Highlighted Expenses',
          series:[ { label: 'Revenue' }, { label: 'Profit' }, { label: 'Expenses' } ],
          legend: { show: true, placement: 'outsideGrid' },
  2. To fill in the gap between the two lines, we use the fillBetween option. The only...

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