如下图所示,dash_daq.Gauge输出的环太细。
python - Dash(Python)-仪表盘中较粗的仪表盘-LMLPHP
我想要更厚的戒指。我在“检查元素”下找不到css元素来增加环的厚度。我该怎么做?

最佳答案

只需创建一个assets文件夹,然后将您的css文件放置在该文件夹中,例如“ styles.css”,它可以正常工作(Dash v1.6.0)

styles.css:

circle {
    stroke-width: 20px;
}


app.py:

import dash
import dash_daq as daq
import dash_core_components as dcc
import dash_html_components as html

app = dash.Dash(__name__, assets_folder = 'assets', include_assets_files = True)

app.layout = html.Div([
    daq.Gauge(
        id='my-gauge',
        label="Default",
        value=6,
        style={'display': 'block' }
    ),
    dcc.Slider(
        id='my-gauge-slider',
        min=0,
        max=10,
        step=1,
        value=5
    ),
])

@app.callback(
    dash.dependencies.Output('my-gauge', 'value'),
    [dash.dependencies.Input('my-gauge-slider', 'value')]
)
def update_output(value):
    return value

if __name__ == '__main__':
    app.run_server(debug=True)


python - Dash(Python)-仪表盘中较粗的仪表盘-LMLPHP

关于python - Dash(Python)-仪表盘中较粗的仪表盘,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/58871653/

10-12 21:48