Book Image

Learning jqPlot

By : Scott Gottreu
Book Image

Learning jqPlot

By: Scott Gottreu

Overview of this book

Table of Contents (19 chapters)
Learning jqPlot
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Using the highlighter plugin


We move on to the highlighter plugin. This plugin works very much like the cursor plugin, but it only highlights the data point that our cursor is hovering over. We will start with the Social Media Shares chart from Chapter 2, More Line Charts, Area Charts, and Scatter Plots, found in 1168_02_01.html, which we created last week. There are a lot of data points to test with:

  1. We start by including the highlighter plugin file with the other included JavaScript files:

    <script src="../js/jqplot.dateAxisRenderer.min.js"></script>
    <script src="../js/jqplot.highlighter.min.js"></script>
    
  2. We will only add the highlighter option to our chart. No other change to the chart is necessary. As with the cursor plugin, we set show to true to enable the highlighter plugin. We want a halo to appear around the data point when we highlight it, so we set showMarker to true:

        highlighter: {
          show: true,
          showMarker: true,

    Note

    Non-rendering plugins such...