Bar highlight

Hover a bar to darken it; others stay put.

Chart type
Bar bar
Tier
Free Core
Collection
Highlight filter
Render
Live, site theme
View .md Agent setup
LIVE/highlight-filter/bar-highlight11 of 23 in Highlight & filter

Configuration

Raw Standalone
const options = {
  chart: {
    height: 380,
    fontFamily: "Inter, Geist, \"IBM Plex Sans\", system-ui, sans-serif",
    type: "bar",
    toolbar: {
      show: false
    }
  },
  series: [
    {
      name: "NPS",
      data: [62, 54, 48, 41, 37, 22, 15]
    }
  ],
  xaxis: {
    categories: ["Lisbon", "Porto", "Madrid", "Paris", "Rome", "Athens", "Dublin"]
  },
  plotOptions: {
    bar: {
      horizontal: true,
      borderRadius: 3,
      distributed: true
    }
  },
  legend: {
    show: false
  },
  states: {
    hover: {
      filter: {
        type: "darken",
      }
    }
  },
  title: {
    text: "NPS by office"
  },
  theme: {
    mode: "light",
    preset: "coastal"
  }
}

const chart = new WestCoastCharts(document.querySelector('#chart'), options)
chart.render()