-
Notifications
You must be signed in to change notification settings - Fork 101
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
Is it possible to add the previous data without the chart going to the beginning? #1845
Comments
Would you be able to post your whole chart and data on CodePen/jsFiddle so that we can test? |
https://codepen.io/Paulo-Favero/pen/RNwbeGK As you can see, the chart goes to begin. My intention is to keep at the same place when timeout ends and load more data. |
Thanks. I'm still not sure what's the issue. I load your chart, zoom in, the data updates, but the zoom stays at the place I zoomed to. |
OK, so the axis tries to retain the same position, even if the underlying data scope changes. If you need to keep exact same date scope across updates, you can follow this workflow:
setTimeout(() => {
var from = dateAxis.getPrivate("selectionMin");
var to = dateAxis.getPrivate("selectionMax");
const aggregatedTicksRef = [...oldDataAggregated, ...dataAggregated]
valueSeries.data.setAll(aggregatedTicksRef);
valueSeries.events.once("datavalidated", function(ev) {
dateAxis.zoomToValues(from, to);
})
},5000) |
It works, but once data is loaded - after 5 seconds - the chart shakes. |
If you do not need the animation, you can disable it by passing 0 to zoom function: dateAxis.zoomToValues(from, to, 0); |
Keeps blinking. But now is more faster. You can see on https://codepen.io/Paulo-Favero/pen/RNwbeGK |
@martynasma |
It's me again LOL
I need to keep the chart on the same place after load more past data.
This video shows the chart going to begin. I need to keep it in the same place.
https://github.com/user-attachments/assets/aca843e5-fde6-4774-ac33-fb4f44fd3b04
Thanks
The text was updated successfully, but these errors were encountered: