Open Jackodb opened 5 years ago
This source is useful for automatically updating the chart with data from Bitshares instance: https://dash.plot.ly/live-updates
Currently working on making it dynamic with user input data: https://dash.plot.ly/getting-started-part-2 https://www.youtube.com/watch?v=wv2MXJIdKRY Probably only need to update the input lists (df.Price, df.Current etc.) by appending using user input
Next step is the second comment (look above):
VALUES ALSO GET SUBMITTED ON PAGE REFRESH: https://github.com/plotly/dash/issues/162
if not input1 == '': # This seems to partially prevent the above problem
current.append(input1)
mountain.append(input2)
Current script does not update the chart because data gets appended to the list while you want to add/deduct the order size at a specific price. So, for example, an order gets filled of your initial setup and you add a new order at price X. The bar that represents price X needs to increase with Y amount (where Y amount is order size).
"The bar" in the above sentence represents 'current'!!
DONE!
Both initial and current bar height increase while you only want current bar height to increase. This could be solved by this small script:
current_dict[input_price] += float(input2)
initial_dict[input_price] -= float(input2)
Create a dynamic function that inserts data into the existing bar chart (adds data to stacked part). In an ideal scenario, it would be realtime: Dash Core Components