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

Extending the highlighter plugin to the legend

We can also use the highlighter on bar charts. We decide we will add the highlighter plugin to our stacked bar chart, Monthly Revenue by Product Category, from Chapter 4, Horizontal and Stacked Bar Charts, executing the following steps:

  1. We use the same options as our Social Media Shares chart to which we added the highlighter plugin. However, in this chart, we decide to turn off the halo on the data point; so, we set showMarker to false. We also only want the x value. So, we set tooltipAxes to x:
    ...   
        highlighter: {
          show: true,
          tooltipLocation: 'e',
          showMarker: false,
          tooltipAxes: 'x'
        },
    ...
  2. We will also experiment and highlight the corresponding legend item when we highlight a bar. We'll do that by creating ...

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