首页 > 解决方案 > 如何设置破折号指标图形的尺寸?

问题描述

我在卡片组件中实现了破折号指示器组件,它增加了卡片大小。我试图改变卡片的尺寸,但它只是隐藏了指标内容。如何减小图形的大小?指标代码:

@app.callback(Output("ind_pct_sales", "figure"),
              Input('location_filter', 'value'))

def generate_ind_pct_sales(location_filter):
    filtered_df = filter_dimension(df,location_filter) # filters the data set
    pct_sales = (pct_sales(df=filtered_df))*100 # returns the measure
    fig = go.Figure()
    fig.add_trace(go.Indicator(
        mode="number",
        number={'suffix': "%"},
        value=pct_wsales
    ))
    return fig

标签: pythonplotly-dashdashboardindicatorcard

解决方案


推荐阅读