O'Reilly logo

Learning jqPlot by Scott Gottreu

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Adding trend lines to selected product categories

We can tell from the chart we just created that TVs and computers sell better than DVDs and CDs. However, with so many bars and so little perceived movement in the data between quarters, this chart doesn't tell us much more. This leads us to think about how we can make the chart more interactive. We conclude that adding a trend line to one data series will help us see whether revenue is trending up or down for a given category.

We don't want to create separate charts for each product category; so we will just add a drop-down menu with each product category. When the dropdown changes, it will submit the form and reload the page. We'll add functions to determine which drop-down item is selected, and ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required