apexcharts / apexcharts.js

📊 Interactive JavaScript Charts built on SVG
https://apexcharts.com
MIT License
14.08k stars 1.27k forks source link

candlestick tooltip lines are on the right of the candlestick #3134

Closed 0Lucifer0 closed 2 years ago

0Lucifer0 commented 2 years ago

image It seems like there is a bug on the candlestick charts.

The grid is aligning well with labels but the cursor is always tracing it's line on the right of each candlesticks

this is my configuration

const chartOptions: ApexOptions = {
        chart: {
            background: 'transparent',
            toolbar: {
                show: false
            },
        },
        colors: ['#3C4693', '#7783DB', '#7783DB'],
        dataLabels: {
            enabled: false
        },
        grid: {
            borderColor: theme.palette.divider,
            xaxis: {
                lines: {
                    show: true
                }
            },
            yaxis: {
                lines: {
                    show: true
                }
            }
        },
        legend: {
            show: false
        },
        stroke: {
            colors: ['transparent'],
            show: true,
            width: 2
        },
        theme: {
            mode: theme.palette.mode
        },
        xaxis: {
            type: 'category',
            tooltip: {
                formatter: (val) => {
                    return data[Number(val) - 1]?.x ? Moment(data[Number(val) - 1].x).format('YYYY-MM-DD') : '';
                },
            },
            labels: {
                formatter: (val) => {
                    const mom = Moment(val);
                    if (prices.length < 30) {
                        return mom.format('MMM DD');
                    }
                    return mom.isoWeekday() === 1 || mom.isoWeekday() === 4 ? mom.format('MMM DD') : '';
                },
                rotateAlways: true,
                show: true,
                showDuplicates: false,
                hideOverlappingLabels: true,
            },
            axisTicks: {
                show: true
            }
        },
        yaxis: {
            tooltip: {
                enabled: true
            },
            labels: {
                formatter: (val) => {
                    return `${numeral(val).format('0,0.00')} ${currency}`;
                },
            },
        }
    };
github-actions[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.