0

I want the crosshair always display at the last series in the Candlestick chart without using the mouse hover. How to do that? This is my expect: enter image description here

vnanhtuan
  • 15
  • 1
  • 3

1 Answers1

0

You can change css of those elements, set opacity to 1 so they will always be visible.

.apexcharts-yaxistooltip{
  opacity: 1 !important;
}

.apexcharts-ycrosshairs{
  opacity: 1 !important;
}

You can also add this css after first tooltip render

mouseMove: function (event, chartContext, config) {
  let loaded = false;
  let tooltipY = document.getElementsByClassName('apexcharts-yaxistooltip-text')[0]
  if (tooltipY && tooltipY.innerText && !loaded) {
  let styles = `
  .apexcharts-yaxistooltip {
    opacity: 1 !important;
  }
  .apexcharts-ycrosshairs {
    opacity: 1 !important;
  }
  `
  let styleSheet = document.createElement("style");
  styleSheet.innerText = styles;
  document.head.appendChild(styleSheet);
  loaded = true;
  }
}
Patryk Laszuk
  • 1,160
  • 1
  • 3
  • 14