django 如何更改破折号大小?

gzszwxb4  于 2023-07-01  发布在  Go
关注(0)|答案(1)|浏览(88)

我有一个小尺寸的破折号如何更改破折号大小或父div大小?我使用了一个简单的用法从例子和它的工作正常。但我有大小问题与新破折号

[enter image description here][1]

Dash应用程序

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)

views.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>

相关问题