情节:如何更改悬停标签的格式? [英] Plotly: How can I change the format of hover-on labels?
本文介绍了情节:如何更改悬停标签的格式?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我浏览了在线文档,但是找不到如何更改悬停标签的格式:
I've looked through online documentation, but couldn't find how to change the format of hover-on labels:
例如,如果我想将数字显示为〜61.1万"或类似的数字.
For example, if I'd like to display the number as "~611 thousand" or something of the sort.
推荐答案
使用 Python/d3格式化语言.
在API中,使用轴属性'tickformat'
和'hoverformat'
设置行为.例如,此图具有'layout.yaxis.hoverformat': ',f'
.
From an API, use axis attributes 'tickformat'
and 'hoverformat'
to set the behavior. For example, this graph has 'layout.yaxis.hoverformat': ',f'
.
在网络应用中,在轴"->标签"下输入格式规范:
From the web app, input your formatting specs under "Axes" -> "Labels":
这篇关于情节:如何更改悬停标签的格式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文