python - 如何在python中将标题添加到散景仪表板?
解决方案
正如 Eugene 提到的,您可以使用 div-container 设置标题,然后在列输出中设置它。
这里有一些可能有助于理解的示例代码:
output_file("slider.html")
title = Div(text='<h1 style="text-align: center">Example Header</h1>')
p1 = figure(plot_width=300, plot_height=300)
p1.circle([1, 2, 3, 4, 5], [6, 7, 2, 4, 5], size=20, color="navy", alpha=0.5)
tab1 = Panel(child=p1, title="circle")
p2 = figure(plot_width=300, plot_height=300)
p2.line([1, 2, 3, 4, 5], [6, 7, 2, 4, 5], line_width=3, color="navy", alpha=0.5)
tab2 = Panel(child=p2, title="line")
tabs = Tabs(tabs=[tab1, tab2])
layout = column(title, tabs, sizing_mode='scale_width')
curdoc().add_root(layout)
推荐阅读
- office-js - Outlook Web 加载项:displayDialogAsync() 不起作用
- python - 我收到一个错误列表,指出此字段是必需的
- java - 从 Java 中的数组中加起来价格?
- android - 如何通过 google、Facebook 和 twitter 注册获取特定用户信息?
- vue.js - Vuetify 国际化
- ssms-2017 - SSMS 17.9.1 在“连接”时崩溃
- java - 带有 AND 运算符的 Java 复选框
- html - Display flex 在项目调整大小时提供不一致的滚动行为
- mysql - 使用联合表时如何选择不同的行
- c - 结构体和动态数组