plotly - 数据表插入 HTML 时出错 - 破折号
问题描述
我试图在我的图表之前在我的仪表板中插入一个 DataTable,但我总是收到与数据表相关的错误。
我的代码是:
import dash_table_experiments
import dash
import dash_core_components as dcc
import dash_html_components as html
import pandas as pd
import plotly.graph_objects as go
import numpy as np
import dash_table_experiments as dash_table
import dash
from dash.dependencies import Input, Output
import dash_table
import pandas as pd
html.Div(
dash_table.DataTable(
id='table',
columns=[{"name": i, "id": i} for i in df2.columns],
data=df2.to_dict('records'),
),
)
app = dash.Dash()
app.layout = html.Div([
html.H1(children = "Dashboard Para Gestão De Produção",
style = {'textAlign' : 'center',}),
html.Div(children = "_______________________________",
style = {'textAlign' : 'center',}),
dcc.Graph(
id = 'lines-chart',
figure = {
'data' : [
{'x': df2['OrderType'], 'y': df2['Qty'], 'type': 'bar', 'name': 'Dropado'},
{'x': df2['OrderType'], 'y': df2['OrderTypeProcessed'], 'type': 'bar', 'name': 'Realizado'}
],
'layout' : {
'title': 'Grafico'
}
}
),
])```
错误:
TypeError:意外的关键字参数
data
允许的参数:column_widths、columns、editable、enable_drag_and_drop、filterable、filters、header_row_height、id、max_rows_in_viewport、min_height、min_width、resizable、row_height、row_scroll_timeout、row_selectable、row_update、rows、selected_row_indices、sortColumn、sortDirection、sortable、 tab_index
如何修复此错误?
解决方案
推荐阅读
- php - HTTP ERROR 500 尝试使用 PHP 查询 .mdb Microsoft Access 数据库
- excel - 链接更新时需要暂停 VBA 脚本
- python - 如何创建字典列表的字典
- python - 根据其他参数从 JSON 中提取数据
- angular - ngModel 在 Angular 表单中的意外行为
- javascript - 如果输入为空,则添加和删除类
- php - 致命错误:内存不足(已分配 377487360)(试图分配 371200000 字节)
- javascript - 如何使用函数或变量重用模板文字?
- json - HTTP post 未完成时表单被阻止
- php - 如何与关联数组值进行比较