apexcharts / apexcharts.js

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

Display error Date when set labels for xaxis #4763

Open cuobiezi opened 1 week ago

cuobiezi commented 1 week ago

Description

Steps to Reproduce

  1. Config chart type as 'line'. and xaxis type is 'datetime'
  2. Config max as 1714881301463, min as 1714838101463, tickAmount as 10.
  3. Display xaixs time start close to next day (eg: Sat May 04 2024 23:55:01).
  4. Config labels as
    labels: {
      datetimeUTC: false,
      formatter: undefined,
      datetimeFormatter: {
        year: 'yyyy',
        month: 'MMM yyyy',
        day: 'dd MMM',
        hour: 'HH:mm'
      }
    }

Reproduce Env

I can reproduce both of above chrome version .

Expected Behavior

Display correct Date 4 May at the left of xaxis label .

Actual Behavior

Display incorrect Date 24 May the the left of xaxis label.

Screenshots

image image

Reproduction Link

https://codepen.io/cuobiezi/pen/MWNpqJr

brianlagunas commented 1 week ago

your reproduction link does not reproduce the issue. Nothing is being rendered on the chart as it seems the data is not correct. Please verify the reproduction code.

cuobiezi commented 1 week ago

your reproduction link does not reproduce the issue. Nothing is being rendered on the chart as it seems the data is not correct. Please verify the reproduction code.

Updated data. Actually, My issue didn't relate to data , It is xaxis label display incorrect. Max Time 1714881301463 is 5 May ,Min time 1714838101463 is 4 May. But the xaxis label display start from 24 May, not in the correct range of 4 May - 5 May

brianlagunas commented 1 week ago

I am not seeing the issue you are describing. Can you provide a screenshot of what you are seeing?

cuobiezi commented 1 week ago

I am not seeing the issue you are describing. Can you provide a screenshot of what you are seeing?

Uploaded to description, Thanks.

junedchhipa commented 6 days ago

@cuobiezi What browser are you using? I am unable to see what's in the screenshot.

cuobiezi commented 6 days ago

@cuobiezi What browser are you using? I am unable to see what's in the screenshot.

@junedchhipa Updated reproduce env in the Description , Thanks.

brianlagunas commented 5 days ago

This is what the code pen shows me on Windows and Chrome version 129.0.6668.101

image

cuobiezi commented 2 days ago

This is what the code pen shows me on Windows and Chrome version 129.0.6668.101

image

Your screen xaxis start from 4 May morning. The reproduce case xaixs min config field 1714838101463 the xaixs should be from 4 May start evening. image

cuobiezi commented 2 days ago

@cuobiezi What browser are you using? I am unable to see what's in the screenshot.

that because time zone issue, Please refer step 3 in description

cuobiezi commented 2 days ago

This is what the code pen shows me on Windows and Chrome version 129.0.6668.101 image

Oh , I got it , we are difference time zone, LOL. The reproduce key step is set the xaixs start time close to next day . like (Sat May 04 2024 23:55:01)