[BUG] StreamLit Box, Trend line
Expected Behavior
When Using normally, my box appears at the right place. With this:
chart.box(start_time='2024-11-29 08:07:00', end_time='2024-11-29 08:09:00', start_value=20860, end_value=20870, fill_color='rgba(255, 0, 0, 0.3)', round= True)
I expect my box to start at 8:07 and end at 8:09.
This work when using the chart without Streamlit
Current Behaviour
The box or trend line are at the far left and appears as a little vertical line
Reproducible Example
chart.box(start_time='2024-11-29 08:07:00', end_time='2024-11-29 08:09:00', start_value=20860, end_value=20870, fill_color='rgba(255, 0, 0, 0.3)', round= True)
The same list is use with:
This works
chart = Chart()
chart.set(df_nq)
chart.show(block=True)
This do not work:
chart = StreamlitChart(width=900, height=600)
chart.set(df_nq)
chart.load()
Environment
- OS:Mac os
- Library: 2.1
Changing it like this seems to solve the problem.Hope it helps you.
Changing it like this seems to solve the problem.Hope it helps you.
The calculated _interval and offset are wrong for drawing single elements because of the flawed and overly clever _set_interval method, that is a very terrible implementation!
def _set_interval(self, df: pd.DataFrame):
...
Overriding the _set_interval method in the inheritance might be a good idea.