gpt4 book ai didi

python - Dash(Python) - dash-daq 仪表中的较厚环

转载 作者:太空宇宙 更新时间:2023-11-03 22:12:04 30 4
gpt4 key购买 nike

戒指dash_daq.Gauge输出太薄,如下图所示。
gauge meter with thin ring
我想要更厚的戒指。我在'inspect element'下找不到css元素来增加环的厚度。我该怎么做?

最佳答案

只需创建一个 assets 文件夹并将您的 css 文件放在那里,例如“styles.css”,它工作正常(Dash v1.6.0)

样式.css:

circle {
stroke-width: 20px;
}

应用.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)

enter image description here

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

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com