How to define the type of aggregation in px.line chart?

Hi,

I have a px.line chart as follows:

fig_incidentReporting = px.line(df_aggregated_incidents,
x=“FYMonth”,
y=‘Claims’,
color=“FY”,
title=“Claims”,
color_discrete_sequence=colors,
render_mode=“SVG”,
height=350,
hover_data=[“FY”, “FYMonth”, “Claims”]
)

Now in the above line chart my aggregation is not coming out correctly. I want to sum my Y axis but it plots each and every value of Y axis as is despite the dataframe being grouped by etc.

Can i use something like below in px.line ? If so then can someone share how ?

transforms = [dict(
type = ‘aggregate’,
groups = df_aggregated_incidents[‘FYMonth’],
aggregations = [dict(
target = ‘y’, func = ‘sum’, enabled = True),
]
)]

Hi @chopchop30 ,

Maybe you could help me to understand your question. What do you mean by aggregated in this case? The cumulated sum? Could you also explain a bit, what you have in mind with transforms?