在python Plotly仪表板中的绘图内拖动一个圆
我正在准备一个仪表板,其中一个要求是在一个绘图的仪表板内向Y轴移动圆圈。我有来自plotly帽子的这段代码,它画了一个圆,但我无法编辑它或将它移向y轴在python Plotly仪表板中的绘图内拖动一个圆,python,plotly-dash,Python,Plotly Dash,我正在准备一个仪表板,其中一个要求是在一个绘图的仪表板内向Y轴移动圆圈。我有来自plotly帽子的这段代码,它画了一个圆,但我无法编辑它或将它移向y轴 import dash import dash_core_components as dcc import dash_html_components as html import dash_bootstrap_components as dbc import plotly.graph_objects as go import plotly.
import dash
import dash_core_components as dcc
import dash_html_components as html
import dash_bootstrap_components as dbc
import plotly.graph_objects as go
import plotly.graph_objects as go # or plotly.express as px
fig = go.Figure()
# Create scatter trace of text labels
fig.add_trace(go.Scatter(
x=[1.5, 3.5],
y=[0.75, 2.5],
text=["Unfilled Circle",
"Filled Circle"],
mode="text",
))
# Set axes properties
fig.update_xaxes(range=[0, 4.5], zeroline=False)
fig.update_yaxes(range=[0, 4.5])
# Add circles
fig.add_shape(type="circle",
xref="x", yref="y",
fillcolor="PaleTurquoise",
x0=3, y0=3, x1=4, y1=4,
line_color="LightSeaGreen",
)
fig.update_layout(width=800, height=800)
config={
'editable': True,
#'showAxisDragHandles' : False,
'edits': {
'shapePosition': True
}
}
app = dash.Dash()
app.layout = html.Div([
dcc.Graph(figure=fig)
])
if __name__ == "__main__":
app.run_server( port = 8052, debug=True)
我在配置中将可编辑设置为true,但仍然无法移动。有人能帮忙吗
谢谢,
缺口