Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions src/market_analy/charts.py
Original file line number Diff line number Diff line change
Expand Up @@ -1755,8 +1755,8 @@ def _init_synced_tooltip(self) -> None:
y=[],
scales=scales,
marker="crosshair",
stroke_width=2.5,
default_size=120,
stroke_width=2,
default_size=60,
visible=False,
)
self._synced_tooltip_mark = bq.Label(
Expand Down Expand Up @@ -1796,7 +1796,10 @@ def _format_synced_tooltip_value(self, value: float) -> str:

@property
def _synced_tooltip_prefix(self) -> str:
"""Label prefixing the synced-tooltip value."""
"""Label prefixing the synced-tooltip value.

To omit a prefix host should override to return an empty string.
"""
return self.title or "Value"

def _synced_tooltip_fields(self, x: pd.Timestamp) -> list[tuple[str, str]] | None:
Expand Down Expand Up @@ -1889,7 +1892,9 @@ def show_synced_tooltip(self, x: pd.Timestamp) -> None:
if not fields or anchor is None:
self.hide_synced_tooltip()
return
text = " | ".join(f"{label}: {value}" for label, value in fields)
text = " | ".join(
(f"{label}: {value}" if label else value) for label, value in fields
)
color = self._tooltip_color(x)
cross_color = self._synced_tooltip_cross_color(x)

Expand Down
Loading