Linear regression fails on Date format
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.
@dvago Have you solved this problem? Or perhaps there is another way out?
no, unfortunately, it still an issue
您好,这里是周敏。您的来信我已收到,我会在查看后的第一时间给你回复。
i solved the problem. can be closed pass date as timestamp axis type (where date) - time
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?
I solved my problem through axisPointer -> Formatter.