Quantcast
Channel: 🎛️ Dash - Plotly Community Forum
Viewing all articles
Browse latest Browse all 6271

Scattergl not working with 700,000 sensor readings when x = datetime

$
0
0

@happyday wrote:

I have sensor readings where I plot the reading on y and datetime on x. When I use arange(len(readings)) Scattergl works. When I use the datetime, I get runtime disconnect. I am running within Google colab.

import numpy as np

x_axis = np.arange(df['Pa'].count())

# Create figure
fig = go.Figure()

fig.add_trace(
    go.Scattergl(
        x = x_axis,
        # x = df['Pa'].index,
        y = df['Pa']
     )
)
fig.update_layout(title_text='title',
                      xaxis_rangeslider_visible=True)
fig.show()

The above works because x is 0 to the number-1 of readings. The above does not work when x is the datetime.
Note: Readings are one second apart:

--------------------------
Start index: 2020-01-12 13:56:10.411604643-08:00
--------------------------
End index: 2020-01-21 03:00:43.241627693-08:00
--------------------------

It is not clear to me why I am successful using integer increments on x. But using datetime fails? Any advice appreciated.

Thank you.

Posts: 2

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 6271

Trending Articles