question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Hover tool on hv.Area

See original GitHub issue

The hover tool on an Area chart does not show any information for me. Here’s a small example:

import numpy as np
import holoviews as hv
hv.extension('bokeh')

# create some example data
python=np.array([2, 3, 7, 5, 26, 221, 44, 233, 254, 265, 266, 267, 120, 111])
pypy=np.array([12, 33, 47, 15, 126, 121, 144, 233, 254, 225, 226, 267, 110, 130])
jython=np.array([22, 43, 10, 25, 26, 101, 114, 203, 194, 215, 201, 227, 139, 160])

dims = dict(kdims='time', vdims='memory')
python = hv.Area(python, label='python', **dims)
pypy   = hv.Area(pypy,   label='pypy',   **dims)
jython = hv.Area(jython, label='jython', **dims)

overlay = (python * pypy * jython).options('Area', fill_alpha=0.5, tools=['hover'])
overlay.relabel("Area Chart") + hv.Area.stack(overlay).relabel("Stacked Area Chart")

I would except the hover information to show up either on any location inside the area with the nearest x value and respective y value, or at least show up when hovering the borderline of an area.

bokeh: 1.0.0rc4 holoviews: 1.11.0a10

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:3
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
whfreelovecommented, Feb 5, 2020

@SandervandenOord sorry for getting your intent wrong!

tooltips_logs = [
  ('Time', '@time{%H:%M:%S.%3N}'),
  ('Value', '@measurement{0,0}'),
  ('Target', '@target{0,0}')
]
formatters_logs = {
    'time': 'datetime'
}
hover_logs = HoverTool(tooltips=tooltips_logs, formatters=formatters_logs, mode='vline')

hv_log_area = hv.Area(data, 'time', ['measurement', 'target'])
hv_log_curve = hv.Curve(data, 'time', ['measurement', 'target']).opts(tools=[hover_logs])

Where data is a Pandas Dataframe containing at least those three columns. For context, these are some logs with timestamps, measured values, and intended target value.

In the HoverTool setup, mode='vline' gets you the behavior of showing the tooltip while in the area. It doesn’t quite work when zoomed in, however, since the Curve hover tooltip only shows when the matching segment of line on the same x is visible.

0reactions
jlstevenscommented, Aug 9, 2022

I will close this issue in favor of discussion on the more recent issue on this topic referenced above (https://github.com/holoviz/holoviews/issues/5375). Please feel free to weigh in with your thoughts there!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Hover tool on hv.Area · Issue #3187 · holoviz/holoviews - GitHub
The hover tool on an Area chart does not show any information for me. Here's a small example: import numpy as np import...
Read more >
Hover tooltip with stacked Area chart in holoviews
I would like the hover tooltip to show the area value below the cursor and potentially other dimensions of my dataset. python ·...
Read more >
Hover tool with categorical aggregates - Datashader
Hello,. I have successfully used holoviews.util.Dynamic to retain the ability to have a dynamic hover tool on coarsely aggregated data with ...
Read more >
Custom Interactivity — HoloViews v1.15.3
Computing statistics in response to selections applied with box- and lasso-select tools. Currently only the bokeh backend for HoloViews supports the linked ...
Read more >
Configuring plot tools — Bokeh 2.4.3 Documentation
The box zoom tool allows you to define a rectangular region to zoom the plot ... Here is a complete example of how...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found