Keeping x-axis tag while changing hoverinfo


#1

I want to keep the year hovertag on the x-axis while changing hoverinfo to show only my number as a string with commas. Basically, I need to combine the two images to show the circled features together. Below is my code. Any help is appreciated. Thanks!

var trace1 = {
      x: currentYear,
      y: currentAdm,
      text: currentStr,
      mode: 'lines+markers',
      marker: {
        size: 7,
        opacity: 0.5
      },
      line: {
        dash: 'solid',
        color: 'rgb(0, 96, 169)',
      },
      hoverinfo: 'text'
    };

#2

Setting hoverinfo: 'x+text' should do the trick: https://codepen.io/etpinard/pen/MxXMXO


#3

That’s perfect! Thanks!