Plotly:如何更改悬停标签的格式? [英] Plotly: How can I change the format of hover-on labels?

查看:22
本文介绍了Plotly:如何更改悬停标签的格式?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我浏览了在线文档,但找不到如何更改悬停标签的格式:

I've looked through online documentation, but couldn't find how to change the format of hover-on labels:

例如,如果我想将数字显示为~611,000"或类似的东西.

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":

这篇关于Plotly:如何更改悬停标签的格式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆