I want to plot a plotly.express.area
diagram with
px.area(df, x="date", y="count_cum", color="topic")
This is the way the df is looking:
date topic count_cum count
0 2021-03-05 topic_1 1 1
1 2021-03-05 topic_2 1 1
2 2021-03-06 topic_1 2 1
3 2021-03-07 topic_1 3 1
4 2021-03-07 topic_2 2 1
The problem is that the cumulated column of topic_2
is not present on 2021-03-06 and the graph of topic_2
falls to 0
at that day. Is there a way to prevent this? Or if not how can I adjust the df
?
I think the target should be like this if plotly can't do:
date topic count_cum count
0 2021-03-05 topic_1 1 1
1 2021-03-05 topic_2 1 1
2 2021-03-06 topic_1 2 1
3 2021-03-06 topic_2 1 0
4 2021-03-07 topic_1 3 1
5 2021-03-07 topic_2 2 1