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

How to update zoomed graph datapoints if dataset is is shifted in x axis ? #129

Open
NiTRoeSE opened this issue Dec 15, 2023 · 0 comments
Open

Comments

@NiTRoeSE
Copy link

Hi, first of all thanks for your work on this plugin!
Is there any way to update the zoomed area to reload the datapoints ?

I have following problem:
I have 2 wattage graphs from fit files in 1 canvas.
Sometimes the recordings are slightly time shifted, so i implemented the possibility to shift the x axis timestamps to be able to move the graphs to match them.

The moving is implemented through manipulation of actual data ( the timestamps are epoch in milliseconds):

 data.map((element) => {
        element["x"] =  element["x"] - 1000
        return element["x"]["y"];
      });
chart.update();

The shifting works fine and graphs gets updated but when the graph moves no additional datapoints where loaded.
So is there any way to call something like chart.crosshair.update(); to tell the plugin to reload the datapoints for the selected time range ?

Here a video wich shows the problem:
( If i zoom out and in again after shifting, all datapoints are present but not if i shift zoomed in)

Bildschirmaufnahme.2023-12-15.um.08.30.36.mp4

I tried to find something in code of plugin, but i´m not a js developer and didn't understand it well.
Some help would be great, thanks in advanced !

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

1 participant