Hi
I am trying to plot weekly totals in Dash and I have my data summarised in a df by “Week Commencing” dates.
The figure I am generating is this:
{'data': [Scatter({
'mode': 'lines',
'name': 'Trace1',
'x': array([datetime.date(2019, 12, 30), datetime.date(2020, 1, 6),
datetime.date(2020, 1, 13), datetime.date(2020, 1, 20),
datetime.date(2020, 1, 27), datetime.date(2020, 2, 3),
datetime.date(2020, 2, 10)], dtype=object),
'y': array([[ 790],
[1115],
[1159],
[ 883],
[1018],
[1166],
[ 804]]),
'yaxis': 'y'
}), Scatter({
'mode': 'lines',
'name': 'Trace2',
'x': array([datetime.date(2019, 12, 30), datetime.date(2020, 1, 6),
datetime.date(2020, 1, 13), datetime.date(2020, 1, 20),
datetime.date(2020, 1, 27), datetime.date(2020, 2, 3),
datetime.date(2020, 2, 10)], dtype=object),
'y': array([[ 0],
[ 0],
[ 0],
[ 0],
[ 0],
[716],
[890]]),
'yaxis': 'y'
})], 'layout': Layout({
'autosize': False,
'legend': {'orientation': 'h'},
'margin': {'b': 30, 'l': 20, 'r': 0, 't': 20},
'showlegend': True,
'xaxis': {'autorange': True, 'showline': True, 'type': 'date'},
'yaxis': {'autorange': True, 'showgrid': True, 'showline': True, 'zeroline': False}
})}
When I run the app I am not seeing any of the data points on the chart and my x axis appears to be in milliseconds (I have tried both datetime and date only objects with the same result):
Can anyone spot where I’m going wrong with this?
TIA