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

Formatting x axis timestamp for Axis.TIME #34

Closed
optio50 opened this issue Nov 22, 2023 · 4 comments
Closed

Formatting x axis timestamp for Axis.TIME #34

optio50 opened this issue Nov 22, 2023 · 4 comments

Comments

@optio50
Copy link

optio50 commented Nov 22, 2023

Hello,
After much trial and error I think I have found the problem with what I thought was a roll_on_tick issue (it was only a symptom of the timestamp issue).
It would seem that its related to my Axis.TIME time format.
prior to 0.6.9 I have formatted and used the timestamp as follows.

(relevant portions)

import time
MP_bottom_axis = LiveAxis("bottom", **{Axis.TICK_FORMAT: Axis.TIME})
timestamp = time.time()
self.Exterior_Temp_connector.cb_append_data_point(TempSensor3, timestamp)

This no longer works and it results in a chart that is zoomed out.
omitting the timestamp in the connector.cb_append_data_point, it displays fine but obviously the time is incorrect.

In all the examples you have provided, such as (live_plot_range.py) the time stamp always starts at 14:00

Can you provide an example to show how to update connector.cb_append_data_point with the time of the data update?

I can provide a more complete example if needed.

@domarm-comat
Copy link
Owner

Ok, I found out where the problem is. The problem appears, when using LiveAxisRange and roll_on_tick and values much larger than 0 (as time.time() is). I will think about ho to fix it using some smart general solution which won't brake other things :). Thanks for your patience. I will try to fix soon.

@domarm-comat
Copy link
Owner

@optio50, I made a possible fix for your issue. Could you please try to run your code against https://github.com/domarm-comat/pglive/tree/liveplot_range_fix branch?
Let me know if that helps. If not, please provide me with some sample data I can use for debugging.

@optio50
Copy link
Author

optio50 commented Nov 23, 2023

I haven't tried it for very long but it seems to be working well. :-)

As always, thank you for your prompt attention and hard work.

@domarm-comat
Copy link
Owner

You're welcome. Thanks for your continous interest and bughunt :). I merged all changes in v0.7.3 If anything, just open new issue.

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

2 participants