Using Python plotly
, the charted data shows linearly increasing data, but is not correct.
Also, the first data point (i.e. 5585
) is rendered as empty bar.
How do I fix these?
import plotly.graph_objects as go
fig = go.Figure()
x = df_quaterly_results.index
y = df_quaterly_results[df_quaterly_results.columns[0]] # Sales Columns
trace_name = 'QoQ Sales'
fig.add_trace(go.Bar(x=x, y=y, name=trace_name))
plot_title = 'QoQ Sales'
fig.update_layout(
title=plot_title,
xaxis_title='Quarter',
yaxis_title='Rupees in Cr.')
# pyo.plot(fig, filename="temp-plot.html")
fig.show()
Sample Dataframe:
Quarterly Results | Sales |
---|---|
Jun 2021 | 5585 |
Sep 2021 | 7096 |
Dec 2021 | 8527 |
Mar 2022 | 7893 |
Jun 2022 | 8607 |
Sep 2022 | 8458 |