freyastreamlit / streamlit-lightweight-charts

Streamlit wrapper for lightweight-charts
MIT License
146 stars 31 forks source link

Query Regarding Use of Dynamic Legends and Tooltips #32

Closed SeifallahSnoussi closed 3 months ago

SeifallahSnoussi commented 1 year ago

Hello,

I wanted to start by saying thank you for the incredible work you've done with this project. I've found it immensely helpful in my work.

I'm reaching out to you because I've been trying to implement dynamic legends and tooltips in a similar manner to those described in the TradingView's lightweight charts. Here are the specific features I'm referring to:

Dynamic Legends: https://tradingview.github.io/lightweight-charts/tutorials/how_to/legends Tooltips: https://tradingview.github.io/lightweight-charts/tutorials/how_to/tooltips

However, I've been unable to figure out if this is possible with the current implementation of your project. Can you clarify if these features are available? If they're not, would you consider adding them to the project in a future update?

Alternatively, if there is a workaround or a different way to achieve similar functionality, I would greatly appreciate it if you could guide me through it.

freyastreamlit commented 1 year ago

Hello @SeifallahSnoussi

Thanks for the kind comments - appreciated

I understand your request, but... we can pass variables' values and JSON between Python and Javascript environments but not functions/methods - that's an inherit limitation.

Having said that I have been looking on the streamlit-agGrid and Pablo has a work around for injecting Javascript passing a markdown text to be evaluated. (he got the inspiration from streamlit-echarts)

I will have a look

Best,

Joe Rosa

SeifallahSnoussi commented 1 year ago

Hello,

Thank you for your prompt and detailed response.

I understand the complexities involved in integrating functions/methods between different languages, and I appreciate your willingness to explore possible solutions despite these limitations.

I must admit that my skills primarily lie in Python, and my experience with Javascript is limited. So any workaround that could be implemented primarily on the Python side would be particularly helpful.

Thank you again for your efforts