Python、破折号 : how to add a KPI Card component to a dashboard

标签 python plotly data-visualization plotly-dash

我是 Dash 新手,正在寻找一个组件 (dash_core_component) 来创建 KPI 卡,在其中可以显示单个值和简短说明。

这里是一个例子:

enter image description here

最佳答案

它不是 dash_core_component,但您可以使用 Cards from the bootstrap dash components创建这样的东西:

enter image description here

import dash_bootstrap_components as dbc
import dash_html_components as html

card = dbc.Card(
    [
        dbc.CardHeader("Marketing"),
        dbc.CardBody(
            [
                html.H4("201 new Leads", className="card-title"),
                html.P("Delivered this week compared...", className="card-text"),
            ]
        ),
    ],
    style={"width": "30rem"},
)

添加到您的 CSS 文件:

.card-text {
  color: #999999;
  margin-bottom: 7.5px;
  display: block;
}

.card-title {
  font-weight: bold;
  font-size: 36px;
  margin-top: 0;
  margin-bottom: 7.5px;
}

关于Python、破折号 : how to add a KPI Card component to a dashboard,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57586258/

相关文章:

python - Django 管理员身份验证失败

Python:获取时间序列线性图中曲线的起止时间

python - Plotly 表达条形图颜色变化

python - 使用 hexbin 的 Pairplot

algorithm - 什么是好的重叠组算法?

python - 如何在 Django ORM 中连接两个表而没有第一个表中的任何列引用第二个

python - Jupyter Notebook - 如何在主屏幕上隐藏除笔记本之外的所有内容?

java - Windows 无法从 eclipse 中运行 python 脚本

python - 常规热图有效,但图工厂热图在 Plotly 中失败

hive - 如何可视化 Hive 数据?