python - 如何更改破折号大小?
问题描述
我有一个小尺寸的破折号 如何更改破折号大小或父 div 大小?我使用了示例中的简单用法,它工作正常。但我对新破折号有尺寸问题
[enter image description here][1]
破折号应用
import dash
import dash_core_components as dcc
import dash_html_components as html
from django_plotly_dash import DjangoDash
app = DjangoDash('SimpleExample') # replaces dash.Dash
app.layout = html.Div(children=[
html.H1(children='Hello Dash'),
html.Div(children='''
Dash: A web application framework for Python.
'''),
dcc.Graph(
id='example-graph',
figure={
'data': [
{'x': [1, 2, 3], 'y': [4, 1, 2], 'type': 'bar', 'name': 'SF'},
{'x': [1, 2, 3], 'y': [2, 4, 5], 'type': 'bar', 'name': u'Montréal'},
],
'layout': {
'title': 'Dash Data Visualization'
}
}
)]) if __name__ == '__main__':
app.run_server(debug=True)
视图.py
from django.shortcuts import render
from django.http import HttpResponse
from . import plotly_app
def index(request):
return render(request, "index.html")
一些重要的设置
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'newtry',
'django_plotly_dash.apps.DjangoPlotlyDashConfig',]
父 div 的默认大小为 0。我使用了很多图表,大小为 0。我认为这可能取决于简单的使用大小形式。但我无法改变这一点
<div style="
position: relative;
padding-bottom: 10.0%;
height: 0;
overflow:hidden;
">
<iframe src="/django_plotly_dash/app/SimpleExample/" style="
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
" frameborder="0"></iframe>
</div>
解决方案
推荐阅读
- cordova - 在 cordova 上找不到 SDK 许可证
- mysql - 具有复合索引但没有主键的Mysql表
- python - 如何将数据从excel导入python数组?
- c# - 当位于 ASP.NET Webapi 循环内的 try catch 块中捕获异常时,Foreach 将停止
- kubernetes-helm - 引用函数与使用引号有什么区别?
- c - 哪个 C 标准头文件定义了 NULL 字符?
- ios - 将 mp4 文件与应用程序捆绑在一起,让用户直接从设备播放视频,而不是从云端下载视频
- excel - 复制和粘贴图表以在 VBA 中滑动
- java - 在 ControlsFX CheckComboBox 中设置默认选中的复选框
- reactjs - 在 JSX 中反应不呈现值