Skip to content

Instantly share code, notes, and snippets.

@dz0
Created February 10, 2022 11:26
Show Gist options
  • Save dz0/ea652323de6b9caee79b8d809e3bfb6d to your computer and use it in GitHub Desktop.
Save dz0/ea652323de6b9caee79b8d809e3bfb6d to your computer and use it in GitHub Desktop.
from ._anvil_designer import Form1Template
from anvil import *
import anvil.tables as tables
import anvil.tables.query as q
from anvil.tables import app_tables
import plotly.graph_objects as go
txt_list = []
class Form1(Form1Template):
def __init__(self, **properties):
# Set Form properties and Data Bindings.
self.init_components(**properties)
# Any code you write here will run when the form opens.
def button_1_click(self, **event_args):
"""This method is called when the button is clicked"""
txt = self.text_box_1.text
txt_list.append(txt)
self.label_1.text = '\n'.join(txt_list)
self.plot_1.data = go.Bar(
x = list(range(len(txt_list))),
y = [len(x) for x in txt_list],
marker=dict(color='#2196f3')
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment