【发布时间】:2018-10-24 04:21:06
【问题描述】:
我想在我的全息视图区域图中添加一个悬停工具,以便用户可以将鼠标悬停在 x/y 坐标上(x 和 y 是谨慎的),悬停工具将捕捉到最近的 x/y 坐标类别。我已将我的选项设置为将工具设置为悬停,但除了交叉悬停之外,我没有看到任何信息。我可以使用下面的教程代码来复制该功能吗?
这里也是教程代码的链接:http://holoviews.org/gallery/demos/matplotlib/area_chart.html
%%output size=200
%%opts Area [height=200 width=400 tools=['hover'] xrotation=90]
%%opts Overlay [width=600 legend_position='top_left' tools=['hover']]
# 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)
overlay.relabel("Area Chart") + hv.Area.stack(overlay).relabel("Stacked Area Chart")
【问题讨论】: