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:
Asked
Active
Viewed 221 times
0

vnanhtuan
- 15
- 1
- 3
1 Answers
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