X axis time index graph

X axis is not showing date time values , rather it shows numeric values.

I want to show date time values in x axis.

My code :slight_smile:

`
import plotly.graph_objects as go
import pandas as pd

df_epg01 = pd.read_csv(‘Graph_Data/EPG/EPG1/pdc_pgw_statistics.csv’,sep=’|’,parse_dates=[‘Time’],index_col=‘Time’)

fig = go.Figure()

fig.add_trace(go.Scatter(y=(df_epg01[‘downlink_bytes’].diff()8)/(900100010001000),
mode=‘lines’,
name=‘uplink Gbps’))
fig.show()
`


Hi @enarban,

You didn’t define the x values for your scatter plot so by default it is just an icremental integer.

Here the code with the x values defined:

import plotly.graph_objects as go
import pandas as pd

df_epg01 = pd.read_csv('Graph_Data/EPG/EPG1/pdc_pgw_statistics.csv', 
                       sep='|', 
                       parse_dates=['Time'], 
                       index_col='Time')

fig = go.Figure()
fig.add_scatter(x = df_epg01.index, 
                y = df_epg01['downlink_bytes'].diff(),
                mode ='lines',
                name ='uplink Gbps')
fig.show()

Alex -