Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dynamic chart #8

Open
Jackodb opened this issue Jun 20, 2019 · 6 comments
Open

Dynamic chart #8

Jackodb opened this issue Jun 20, 2019 · 6 comments

Comments

@Jackodb
Copy link
Owner

Jackodb commented Jun 20, 2019

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

@Jackodb Jackodb added the enhancement New feature or request label Jun 20, 2019
@Jackodb
Copy link
Owner Author

Jackodb commented Jun 22, 2019

This source is useful for automatically updating the chart with data from Bitshares instance:
https://dash.plot.ly/live-updates

@Jackodb
Copy link
Owner Author

Jackodb commented Jun 22, 2019

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):

@Jackodb Jackodb removed enhancement New feature or request labels Jun 22, 2019
@Jackodb
Copy link
Owner Author

Jackodb commented Jun 23, 2019

@Jackodb
Copy link
Owner Author

Jackodb commented Jun 23, 2019

VALUES ALSO GET SUBMITTED ON PAGE REFRESH: plotly/dash#162

  if not input1 == '': # This seems to partially prevent the above problem
        current.append(input1)
        mountain.append(input2)

@Jackodb
Copy link
Owner Author

Jackodb commented Jun 23, 2019

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!

@Jackodb
Copy link
Owner Author

Jackodb commented Jun 23, 2019

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant