Added functionaly to update markers along with ohlc data without manual page reload #18
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
As mentioned in #9, how to add markers at the time of preparing the chart, but I was unable to update marker data after referring \data endpoint which is mentoined in https://colab.research.google.com/drive/1w1T2erRjyz3xLkentuIffI75z9kUkN6_?usp=sharing.
I have updated the update function in pytvlwcharts.py and now by passing markers like:
data={
"ohlc": ndf[["time", "open", "high", "low", "close", "position", "color", "shape", "text"]].tail(1)
.replace('', np.nan).dropna(axis=1,how='any')
.to_dict(orient="records"),
"markers": ndf[["time", "position", "color", "shape", "text"]].replace('', np.nan).dropna().tail(1)
.to_dict(orient="records")[:1],
"volume": ndf[["time", "volume", "volColor"]].tail(1)
.rename(columns={"volume": "value", "volColor": "color"})
.to_dict(orient="records")
}
Chart can easily update markers.