From f73a451bf189482b858caf3b41ce38fe9b7ae468 Mon Sep 17 00:00:00 2001 From: Martin Preuss Date: Mon, 29 Dec 2025 18:36:49 +0100 Subject: [PATCH] add modifiers for daysums, monthsums etc. --- src/lib/aqdiagram/graph/timegraph.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/src/lib/aqdiagram/graph/timegraph.c b/src/lib/aqdiagram/graph/timegraph.c index a184e04..d899da7 100644 --- a/src/lib/aqdiagram/graph/timegraph.c +++ b/src/lib/aqdiagram/graph/timegraph.c @@ -14,6 +14,8 @@ #include #include +#include +#include #include @@ -209,6 +211,31 @@ void AQDG_TimeGraph_ModifyDataAndAddCurve(AQDG_GRAPH *g, const char *sLabel, con case 'S': graphType=AQDG_GRAPH_TYPE_STEPLINE; s++; break; case 'P': graphType=AQDG_GRAPH_TYPE_POINTS; s++; break; case 'B': graphType=AQDG_GRAPH_TYPE_BARS; s++; break; + + case 'A': + newDp=AQDG_Data_Accumulate(dpList); + AQDG_Graph_DataPair_List_free(dpList); + dpList=newDp; + AQDG_Graph_DataPair_List_SortByValueX(dpList, 1); + break; + case 'D': + newDp=AQDG_Data_DaySums(dpList); + AQDG_Graph_DataPair_List_free(dpList); + dpList=newDp; + AQDG_Graph_DataPair_List_SortByValueX(dpList, 1); + break; + case 'M': + newDp=AQDG_Data_MonthSums(dpList); + AQDG_Graph_DataPair_List_free(dpList); + dpList=newDp; + AQDG_Graph_DataPair_List_SortByValueX(dpList, 1); + break; + case 'N': + newDp=AQDG_Data_NegateY(dpList); + AQDG_Graph_DataPair_List_free(dpList); + dpList=newDp; + AQDG_Graph_DataPair_List_SortByValueX(dpList, 1); + break; case 'd': newDp=AQDG_Data_DayAverage(dpList); AQDG_Graph_DataPair_List_free(dpList);