Kanaries / pygwalker

PyGWalker: Turn your pandas dataframe into an interactive UI for visual analysis
https://kanaries.net/pygwalker
Apache License 2.0
13.45k stars 707 forks source link

Close datetimes result in repeated monthly X axis labels #28

Closed rcarmo closed 1 year ago

rcarmo commented 1 year ago

I'm quite enjoying this, but I have come across a serious data interpretation problem.

I have a dataframe read like so:

df = pd.read_sql_query(query,conn, parse_dates=['date'])

However, the datetime values are all relatively high resolution ones (i.e., 5-15 second samples over many days), and the X axis nearly always shows only "2023-02" instead of showing the date (or the hour if I'm looking at the last 24 hours).

Can we get a way to change the X-axis label resolution, or (even better), a stepwise automatic scale to format those datetimes according to the dataset granularity?

ObservedObserver commented 1 year ago

It is a good idea to allow customized label resolutions or formats. (added to future features)

But there are two ways already supported by interactions that might meet your needs:

Chart Resize

demo gif:

Vis Resize

Axis Scaling

demo gif:

axis scaling

rcarmo commented 1 year ago

Actually, that doesn't work for me because I'm trying to see minute or second-level data for the last hour and the labels still show me YYYY-MM. I would have expected it to have switched to HH:MM at least...

ObservedObserver commented 1 year ago

I found it is caused by a fixed format string in graphic-walker. already fixed in the latest version @kanaries/graphic-walker/0.2.12.

After pygwalker upgrades to the latest version of gw, this problem can be fixed. @Asm-Def

But it has not supported custom label format yet (TODO).

ObservedObserver commented 1 year ago

Feb-23-2023 23-12-58

Asm-Def commented 1 year ago

Fixed and released in version 0.1.4.2

See pr https://github.com/Kanaries/pygwalker/pull/34.

BTW: Welcome to join our discord discord invitation link to keep track of the latest progress.

rcarmo commented 1 year ago

Wow, thanks! Will reinstall on my instance and get back to you