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

Linear regression fails on Date format #39

Open
dvago opened this issue Jun 16, 2021 · 5 comments
Open

Linear regression fails on Date format #39

dvago opened this issue Jun 16, 2021 · 5 comments

Comments

@dvago
Copy link

dvago commented Jun 16, 2021

Hi there,

I'm currently looking into an implementation of the default available regressions, it seems like the chart does not draw regression models (just the Linear function) when the input data (source) is containing either a Date object or a timestamp.

Given a source input as dataset with the following structure:

source: [
    [
        Mon Dec 07 2020 00:00:00 GMT+0000 (Greenwich Mean Time),  // This is a valid Date object,
        50.90
    ],
    [
        Wed Oct 30 2019 00:00:00 GMT+0000 (Greenwich Mean Time),  // This is a valid Date object,
        97.90
    ],
]

When I push into the dataset a new transform with the type as ecStat:regression and method as linear no line gets drawn.

note:
The same behaviour happens when the Date object gets converted into a timestamp using the standard Date getTime() method.

note 2:
Regression models like exponential, logarithmic and polynomial draw perfectly fine using both Date object or timestamp, so I believe there must be something wrong within the linear function.

@alexander26k
Copy link

@dvago
Have you solved this problem? Or perhaps there is another way out?

@dvago
Copy link
Author

dvago commented Sep 14, 2022

no, unfortunately, it still an issue

@echodis
Copy link

echodis commented Sep 14, 2022 via email

@alexander26k
Copy link

alexander26k commented Sep 14, 2022

i solved the problem. can be closed
pass date as timestamp
axis type (where date) - time

image

link to example

I really would like to fix something .. if I pass the datetime, it looks great. but if I pass only the date, I get the time - 00:00:00. I would like to remove it in this case. Any ideas?

@alexander26k
Copy link

I solved my problem through axisPointer -> Formatter.

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