name='Vegeterian food ')) fig.add_trace(go.Scatter(x=random_x, y=random_y1, mode='lines+markers', name='Non-Vegeterian food')) fig.update_layout( title="Food Consumption", xaxis_title="Years(yrs)", yaxis_title="Consumption", ) fig.show() plot(fig) #login to dashboard my_dboard = dashboard.Dashboard() my_dboard.insert(box_c) my_dboard.get_preview() my_dboard.insert(box_c, 'left', 1, fill_percent=30) my_dboard.get_box(1) py.dashboard_ops.upload(my_dboard , 'Dashboard of consumption of food ') dboard_names = my_dboard() first_dboard = dashboard(my_dboard[0]) first_dboard.get_preview() else: print("Invalid credentials")
cursor.execute(query) x = list() y = list() for i in cursor.fetchall(): x.append(i[0]) y.append(i[1]) fig = go.Figure(data=[go.Scatter(x=x, y=y, mode='lines+markers')]) third = py.plot(fig, filename='scatter_1') # DASHBOARD dash_board = dashboard.Dashboard() country_geniuses_bar = fileId_from_url(first) medals_pie = fileId_from_url(second) year_average_total_scatter = fileId_from_url(third) bar_ = { 'type': 'box', 'boxType': 'plot', 'fileId': country_geniuses_bar, 'title': 'Amount of top 25 ranks by country' } pie_ = { 'type': 'box', 'boxType': 'plot',
GROUP BY EXTRACT(year FROM intake_datetime) HAVING COUNT(DISTINCT animal_id)>800 ORDER by EXTRACT(year FROM intake_datetime)""" cursor3.execute(query3) years = [] animal_count = [] for record in cursor3.fetchall(): years.append(record[0]) animal_count.append(record[1]) data = go.Scatter(x=years, y=animal_count, mode='lines+markers') quantity_per_year = py.plot([data], filename='Count of animals by year') """--------CREATE DASHBOARD------------------ """ new_dboard = dashboard.Dashboard() shelters_dog_count_id = fileId_from_url(shelters_dog_count) sick_animals_percent_id = fileId_from_url(sick_animals_percent) quantity_per_year_id = fileId_from_url(quantity_per_year) box_1 = { 'type': 'box', 'boxType': 'plot', 'fileId': shelters_dog_count_id, 'title': 'Shelter and count of dogs' } box_2 = { 'type': 'box', 'boxType': 'plot',
) ), yaxis=dict( title='GameCount', titlefont=dict( family='Courier New, monospace', size=16, color='#CB4335' ) ) ) ReleaseDateScatter = go.Figure(data = ScatterData, layout = ScatterLayout) TotalReleaseDate = py.plot(ReleaseDateScatter, auto_open=True, file_name="Plot3") my_dashboard = dash.Dashboard() bar_id = fileId_from_url(TotalGameGenres) pie_id = fileId_from_url(TotalPlatformPercent) scatter_id = fileId_from_url(TotalReleaseDate) box_1 = { 'type': 'box', 'boxType': 'plot', 'fileId': bar_id, 'title': 'QUERY 1' } box_2 = { 'type': 'box', 'boxType': 'plot',
GROUP BY SUBSTR(last_updated,-4,4) ORDER BY SUBSTR(last_updated,-4,4) """ cursor.execute(query) k = list() v = list() for row in cursor: k.append(row[0]) v.append(row[1]) scatter = go.Scatter(x=k, y=v) scatter = py.plot([scatter], auto_open=True) dash = dashboard.Dashboard() bar_id = get_id(bar) pie_id = get_id(pie) scatter_id = get_id(scatter) filed_1 = { 'type': 'box', 'boxType': 'plot', 'fileId': bar_id, 'title': 'Кількість програм кожної категорії з ціною меньше 1 долару' } filed_2 = { 'type': 'box', 'boxType': 'plot', 'fileId': pie_id,
# ----end query3----- bar = go.Bar(y=x_request_1, x=y_request_1) graph_request_1 = py.plot([bar], auto_open=False, filename='request_1') pie = go.Pie(labels=x_request_2, values=y_request_2) graph_request_2 = py.plot([pie], auto_open=False, filename='request_2') scatter = go.Scatter(x=x_request_3, y=y_request_3) graph_request_3 = py.plot([scatter], auto_open=False, filename='request_3') cursor.close() con.close() # dashboard creation --------------------------------------------------- MyBoard1 = dashboard.Dashboard() dia_1 = { 'type': 'box', 'boxType': 'plot', 'fileId': fileId_from_url(graph_request_1), 'title': 'Запит 1: вивести топ 10 країн з максимальною відвідуваносю' } dia_2 = { 'type': 'box', 'boxType': 'plot', 'fileId': fileId_from_url(graph_request_2), 'title': 'Запит 2: вивести відсоток онлайн та офлайн страхувань', } dia_3 = { 'type': 'box',