Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Uncaught Error: Value is null" when using intraday UNIX timestamps #505

Closed
lfnt3 opened this issue Jul 1, 2020 · 3 comments
Closed

"Uncaught Error: Value is null" when using intraday UNIX timestamps #505

lfnt3 opened this issue Jul 1, 2020 · 3 comments

Comments

@lfnt3
Copy link

lfnt3 commented Jul 1, 2020

Hello,

Since 2 days I have this strange issue with my candlestick chart.
For some reason my chart doesn't work anymore with intraday UNIX timestamps. The strange part is that I could swear that it worked all the time before!? What could be the reason for this behavior?

var data_price = [
    { time: 1593618660, open: 9800, high: 11000, low: 9600, close: 10300 },
    { time: 1593618600, open: 10300, high: 11500, low: 10000, close: 11000 },
    { time: 1593618540, open: 11000, high: 11200, low: 9600, close: 10300 },
];
var data_volume = [
    { time: 1593618660, value: 1910329, color: 'rgba(0, 150, 136, 0.8)' },
    { time: 1593618600, value: 3173752, color: 'rgba(0, 150, 136, 0.8)' },
    { time: 1593618540, value: 4173752, color: 'rgba(0, 150, 136, 0.8)' },
];
candleSeries.setData(data_price);
volumeSeries.setData(data_volume);

2020-07-01 at 18 58

But with business day strings it works just fine.

var data_price = [
    { time: '2018-10-19', open: 9800, high: 11000, low: 9600, close: 10300 },
    { time: '2018-10-21', open: 10300, high: 11500, low: 10000, close: 11000 },
    { time: '2018-10-22', open: 11000, high: 11200, low: 9600, close: 10300 },
    { time: '2018-10-23', open: 10300, high: 11000, low: 9600, close: 10300 },
    { time: '2018-10-24', open: 10300, high: 11000, low: 9600, close: 10300 },
];
var data_volume = [
    { time: '2018-10-19', value: 1910329, color: 'rgba(0, 150, 136, 0.8)' },
    { time: '2018-10-21', value: 3173752, color: 'rgba(0, 150, 136, 0.8)' },
    { time: '2018-10-22', value: 4173752, color: 'rgba(0, 150, 136, 0.8)' },
    { time: '2018-10-23', value: 1173752, color: 'rgba(0, 150, 136, 0.8)' },
    { time: '2018-10-24', value: 2173752, color: 'rgba(0, 150, 136, 0.8)' },
];
candleSeries.setData(data_price);
volumeSeries.setData(data_volume);
@lfnt3
Copy link
Author

lfnt3 commented Jul 1, 2020

I found the root cause for the issue! It's simply the order of the UNIX timestamps which is wrong, it has to be from old to new. That's why it worked for the business day strings... Oh boy, I was investigating this issue since 3 days in my code, and then 1 hour after posting it I find the solution...🤪

@lfnt3 lfnt3 closed this as completed Jul 1, 2020
@timocov
Copy link
Contributor

timocov commented Jul 1, 2020

We'll notify about such errors in debug mode in #315.

@amatiash
Copy link

amatiash commented Jul 30, 2020

@lfnt3 You saved me 2 weeks 😆 😅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants