![]() |
Get input for reading DB and refreshing plotly.graph_objects - Printable Version +- Python Forum (https://python-forum.io) +-- Forum: Python Coding (https://python-forum.io/forum-7.html) +--- Forum: GUI (https://python-forum.io/forum-10.html) +--- Thread: Get input for reading DB and refreshing plotly.graph_objects (/thread-37253.html) |
Get input for reading DB and refreshing plotly.graph_objects - michel77777 - May-18-2022 Hi, there is a simple Python appilaction, which reads data from SQL database and shows the result as plotly.graph_objects. I want the get two values from UI for stock and day and read data from SQl database and show the data with plotly.graph_objects. At the moment are both data hard coded: stocksTicker = 'GRVI' the_day='2021-10-14' Could you please giv me some instractions how to extend the code to implement the requirements ? Thanks in advance, Michel df = pd.read_sql(selectString ,con=Engine) trace1 = { 'x': df.t_datetime, 'open': df.o, 'close': df.c, 'high': df.h, 'low': df.l, 'type': 'candlestick', 'name': stocksTicker, 'showlegend': True } # Config graph layout layout = go.Layout({ 'title': { 'text': 'Moving Averages', 'font': { 'size': 15 } } }) fig=go.Figure([trace1]) fig.show() RE: Get input for reading DB and refreshing plotly.graph_objects - michel77777 - May-29-2022 (May-18-2022, 08:55 PM)michel77777 Wrote: Hi, solved |