0
Follow
0
View

Better way to create a tooltip in Altair

dboy2233 注册会员
2023-01-24 22:03

You only need to use alt.ip on the fields where you want to change the default tooltip formatting:

import altair as alt
from vega_datasets import data

source = data.cars()

alt.Chart(source).mark_circle(size=60).encode(
    x='Horsepower',
    y='Miles_per_Gallon',
    color='Origin',
    tooltip=[
        'Origin',
        alt.Tooltip('Horsepower', format="$.3s", title="Valor")
    ]
)

And just a reminder to post a full minimal reproducible example with code and data for your next question.

About the Author

Question Info

Publish Time
2023-01-24 22:03
Update Time
2023-01-24 22:03

Related Question

Executor服务与Inputstream,读取txt文件在多线程

FactoryBot:多级关联?

在React Native中显示在屏幕边界内的标记的Firestore数据查询

用PHP发送邮件.FROM函数和Reply-To函数不工作

大数据框架中的hadoop和hive spark presto tez是什么关系

java 中Iterable和Iterator的使用

如何找到python内置模块的实现python文件,即itertools

在ADFS中如何处理AWS Cognito的公钥

Firebase云功能:在for循环中从Firestore获取数据?

设置“允许所有已验证”后无法访问Firestore