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

Support timeseries #30

Merged
merged 1 commit into from
Nov 4, 2020
Merged

Support timeseries #30

merged 1 commit into from
Nov 4, 2020

Conversation

Coriou
Copy link
Contributor

@Coriou Coriou commented Apr 1, 2020

If the scale type is a timeseries, calculations will be based on the timestamp gathered from the x axis

Should allow this plugin to work out of the box with most charts (doesn't affect non-timeseries charts)

If the scale type is a timeseries, calculations will be based on the timestamp gathered from the x axis

Should allow this plugin to work out of the box with most charts (doesn't affect non-timeseries charts)
if (data == null) return;

if (xScale.options.type === "time")
fitter.add(new Date(data.x).getTime(), data.y);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

x can also be t according to the docs

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
fitter.add(new Date(data.x).getTime(), data.y);
fitter.add(new Date(data.x || data.t).getTime(), data.y);

Would do the trick ?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

doh dang I thought I PR'd into your fork #35

@Makanz Makanz merged commit ec11b78 into Makanz:master Nov 4, 2020
@Makanz
Copy link
Owner

Makanz commented Nov 4, 2020

Big thanks for your PR. Sorry for my late reply.

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

Successfully merging this pull request may close these issues.

None yet

3 participants