Hello,
I have the following code to create a scatter line,
for i in locations:
d.append(df2[(df2["Parkplatz"] == i) & (df2["Status"] == 0)]["Uhrzeit"].unique())
xvalues = list(itertools.chain.from_iterable(d))
for i in xvalues:
yvalueavailables.append(df2[(df2["Uhrzeit"] == i)].shape[0])
filteredvalues = []
for i in xvalues:
filteredvalues.append(i)
trace.append(go.Scatter(
x=xvalues,
y=yvalueavailables,
name='available',
mode='lines',
marker={'size': 8, "opacity": 0.6, "line": {'width': 0.5}, 'color': '#44A926'}
)
)
return {
'data': trace,
'layout': go.Layout(
showlegend=True,
xaxis={'title': 'Time'},
yaxis={'title': 'Number of Parking places'},
hovermode='closest',
title='Prediction of availability during the selected period'
)
}
The y axis has the following value
[111, 86, 59, 38, 26, 15, 111, 86, 59, 38, 26, 15, 4, 3, 3, 3, 3, 3, 3, 3, 111, 86, 59, 38, 26, 15, 4, 3, 3, 3, 3, 3, 3, 3, 3, 111, 86, 59, 38, 26, 15, 111, 86, 59, 38, 26, 15, 4, 3, 3, 3, 3, 3, 3, 3, 3]
X axis has a corresponding time for each value
However the created graph looks like this, some data points are not at all plotted and the graph is distorted, what am i doing wrong?