chartjs / chartjs-chart-financial

Chart.js module for charting financial securities
MIT License
721 stars 196 forks source link

hitRadius does not work for financial charts #101

Open LongPeakBlue opened 3 years ago

LongPeakBlue commented 3 years ago

I am trying to use options.hitRadius to control the visibility of the OHLC candle tooltip popup, however it is not working.

fin

The documentation for hitRadius can be found at https://www.chartjs.org/docs/latest/configuration/elements.html#point-configuration. It is working fine for normal, non-financial chartjs charts. However when I try to use options.hitRadius for financial-chartjs, it does not work.

No matter where I place my mouse, how far away from the candlestick, the hitRadius does not seem to get taken into account, and a tooltip displaying the OHLC values is always showing when mousing over the chart.

Does anybody know how to control the hit radius for financial charts? Has anybody managed to control the tooltip hit radius for financial chartjs? Is it possible?

var ctx = document.getElementById('chart').getContext('2d');

var myChart = new Chart(ctx, {
    type: 'candlestick',
    data: {
        datasets: [{
            data: data
        }]
    },
    options: {
        hitRadius: 100
    }
});

Thank you