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

Set OHLC x-axis tooltip to datetime format #1493

Merged
merged 8 commits into from
Feb 11, 2025
Merged

Conversation

Azaya89
Copy link
Collaborator

@Azaya89 Azaya89 commented Feb 6, 2025

import pandas as pd
import hvplot.pandas  # noqa
from bokeh.sampledata import stocks

df = pd.DataFrame(stocks.AAPL)
df['date'] = pd.to_datetime(df.date)

df.iloc[-50:].hvplot.ohlc(grid=True)

image

@Azaya89 Azaya89 requested a review from hoxbro February 6, 2025 14:00
@Azaya89 Azaya89 self-assigned this Feb 6, 2025
hvplot/converter.py Outdated Show resolved Hide resolved
@Azaya89
Copy link
Collaborator Author

Azaya89 commented Feb 6, 2025

Ah, @%#$!

@Azaya89 Azaya89 requested a review from hoxbro February 6, 2025 15:58
@hoxbro hoxbro requested a review from maximlt February 6, 2025 17:40
assert '{%F}' in x_tooltip
formatter_key = '@' + x_label
formatter = hover_tool.formatters
assert formatter.get(formatter_key) == 'datetime'
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
assert formatter.get(formatter_key) == 'datetime'
assert formatter[formatter_key] == 'datetime'

hvplot/tests/plotting/testohlc.py Show resolved Hide resolved
hvplot/converter.py Outdated Show resolved Hide resolved
@Azaya89 Azaya89 requested a review from maximlt February 11, 2025 13:58
@maximlt maximlt merged commit 6b03a1b into holoviz:main Feb 11, 2025
11 checks passed
@Azaya89 Azaya89 deleted the OHLC-1487 branch February 11, 2025 22:05
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.

OHLC hover text date format bug
3 participants