I am quite new to plotly, hopefully this is not too silly of a question.
Pulling data from mysql:
df = pd.DataFrame( [[ij for ij in i] for i in results] )
df.rename(columns={0: 'checkin_time', 1: 'license', 2: 'licensed_endpoints', 3: 'total_endpoints'}, inplace=True);
df = df.sort_values(['checkin_time'], ascending=[0]);
df.head()
Returns:
checkin_time license licensed_endpoints total_endpoints
0 2020-02-26 21:58:28 2264483e-102a-4280-b7a2-8d2dd716936b 340000.0 77085.0
1 2020-02-20 23:49:54 2264483e-102a-4280-b7a2-8d2dd716936b 256000.0 43918.0
2 2020-02-13 23:40:04 2264483e-102a-4280-b7a2-8d2dd716936b 240000.0 43035.0
3 2020-02-06 23:42:51 2264483e-102a-4280-b7a2-8d2dd716936b 240000.0 64893.0
4 2020-01-30 23:54:08 2264483e-102a-4280-b7a2-8d2dd716936b 240000.0 80067.0
Now I want to plot, actually I would like to graph the checkin_time as X and both the licensed_endpoints and total_endpoints as Y on a bar chart or something. However, I cannot even get one of them to work using Figure.
When I setup the trace:
trace1 = go.Figure(
x=df['checkin_time'],
y=df['licensed_endpoints']
)
I always get a type error:
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-17-233aeadd3e03> in <module>
1 trace1 = go.Figure(
2 x=df['checkin_time'],
----> 3 y=df['licensed_endpoints']
.
.
.
~/.pyenv/versions/3.7.5/lib/python3.7/site-packages/plotly/basedatatypes.py in __init__(self, data, layout_plotly, frames, skip_invalid, **kwargs)
276 self[k] = v
277 elif not skip_invalid:
--> 278 raise TypeError("invalid Figure property: {}".format(k))
279
280 # Magic Methods
TypeError: invalid Figure property: x
Any ideas where I am going wrong?
Many thanks