错误将数据表插入HTML- Dash

时间:2019-11-12 10:44:38

标签: plotly hyphen

我试图在图表之前在仪表板中插入一个数据表,但总是出现与数据表有关的错误。

我的代码是:

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,可编辑,enable_drag_and_drop,可过滤,   过滤器,header_row_height,id,max_rows_in_viewport,min_height,   min_width,可调整大小,row_height,row_scroll_timeout,row_selectable,   row_update,行,selected_row_indices,sortColumn,sortDirection,   可排序,tab_index

如何解决此错误?

0 个答案:

没有答案