question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

There is a problem with the chart timestamp conversion time

See original GitHub issue

Lightweight Charts Version:1.1.0

Steps/code to reproduce:

Actual behavior: I am ready for the data, the timestamp is set to 1571210040 when setData in the chart, but there is a problem in rendering time.

The timestamp seems to be a problem when converting

Expected behavior:

Screenshots image image

CodeSandbox/JSFiddle/etc link:

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:13 (6 by maintainers)

github_iconTop GitHub Comments

4reactions
saurabBajgaincommented, Dec 3, 2019

@timocov please check this one:- https://jsfiddle.net/saurab_93/ghc74Ldu/2/ Capture_chart_img

data i feed to chart is of dec 2 2019 as you can see in console but at chart it is ploting from dec 1 2019. do you have any idea how to ressolve this… thankyou.

i solve this issue… !!! https://jsfiddle.net/saurab_93/ghc74Ldu/15/

1reaction
saurabBajgaincommented, Dec 4, 2019

@saurabBajgain Actually it isn’t data of 2nd December

image

We use UTC value of the date:

>>> new Date(1575216000000).toISOString()
<<< 19:26:49.816 "2019-12-01T16:00:00.000Z"

If you want to see it as 2nd Dec, you need to add an alignment of the timezone for every bar you have.

yeah this method dateToChartTimeMinute() helps me :- function dateToChartTimeMinute(date) { return Date.UTC(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), date.getMinutes(), 0, 0) / 1000; };

https://jsfiddle.net/saurab_93/ghc74Ldu/15/

Thankyou for your response

Read more comments on GitHub >

github_iconTop Results From Across the Web

Convert Time Zone gives unusual results - but only sometimes?
Solved: Hi - i have a flow that is doing an API call to a service, which responds with a unix timestamp. i'm...
Read more >
Converting Unix Timestamp to Date and Displaying it on ...
Dear all, My LineChart displays the next 7 days high-low temperatures. While Y-axis indicates temperature records, X-axis indicates the dates.
Read more >
The dates and times in my questions and charts are wrong
Your question or chart is comparing or sorting values with inconsistent or missing time zones. For example, if a flight's departure and arrival...
Read more >
Timestamps, Time Zones, Time Ranges, and Date Formats
During ingestion, we can detect the message timestamp, convert it to Unix epoch time (the number of milliseconds since midnight, January 1, 1970...
Read more >
Altair time transforms are off? - Using Streamlit
After some googling it seemed that the date format was causing this issue, so I converted the local_time column to an ISOFORMAT which...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found