-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
plot for trailing 12 months #29
Comments
Hey @bhargavkakadiya , thanks for reaching out. Unfortunately this is something that has been on my to-do list for a while now. The best I can do for you is the import numpy as np
import pandas as pd
from plotly_calplot.calplot import calplot
# mock setup
dummy_start_date = "2022-12-01"
dummy_end_date = "2023-10-03"
dummy_df = pd.DataFrame(
{
"ds": pd.date_range(dummy_start_date, dummy_end_date, tz="Singapore"),
"value": np.random.randint(
-10,
30,
(pd.to_datetime(dummy_end_date) - pd.to_datetime(dummy_start_date)).days
+ 1,
),
}
)
fig1 = calplot(
dummy_df,
x="ds",
y="value",
years_as_columns=True
)
fig1.show() |
When I end up doing the 12 month trailing plot, it will be a separate function to calplot and I'll mention this issue in the release. |
Thanks @brunorosilva the update and closest solution to task. |
I'll check it over the weekend to see if it's as easy as I'm thinking and give you an estimate. |
Hey mate, I tried to work on it over the weekend but it's harder than I thought. I'll keep on working on it and give another update once it's closer to a solve. |
thanks for the update and trying out @brunorosilva I have moved to different representation for now and hope to see this feature and try it out soon |
Is it possible to have plot combining two different years for use case such as: trailing 12 months?
So w.r.t. to given Image, expected result which starts at month Feb and ends at Jan in a single row
The text was updated successfully, but these errors were encountered: