add modifiers for daysums, monthsums etc.

This commit is contained in:
Martin Preuss
2025-12-29 18:36:49 +01:00
parent 082efeb57d
commit f73a451bf1

View File

@@ -14,6 +14,8 @@
#include <aqdiagram/data/date.h>
#include <aqdiagram/data/floatingavg.h>
#include <aqdiagram/data/accumulate.h>
#include <aqdiagram/data/negate.h>
#include <gwenhywfar/debug.h>
@@ -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);