simplified graph usage.

This commit is contained in:
Martin Preuss
2025-10-01 23:12:04 +02:00
parent f11c4ded86
commit 27383022e7

View File

@@ -184,7 +184,7 @@ int test4()
dpList=_mkTestData2(); dpList=_mkTestData2();
AQDG_TimeGraph_AddCurve(g, "Testdata2", AQDG_GRAPH_TYPE_POINTS, dpList); AQDG_TimeGraph_AddCurve(g, "Testdata2", AQDG_GRAPH_TYPE_POINTS, dpList);
AQDG_TimeGraph_SetupTicks(g); AQDG_TimeGraph_SetupTicks(g, 0, 0.0, 0.0);
dc=AQDG_Draw_ContextCairo_Png_new("/tmp/testgraph.png", 800, 600); dc=AQDG_Draw_ContextCairo_Png_new("/tmp/testgraph.png", 800, 600);
graphObject=AQDG_GraphWidget_new(NULL, AQDG_OBJECT_OPTIONS_STRETCHX | AQDG_OBJECT_OPTIONS_STRETCHY, dc); graphObject=AQDG_GraphWidget_new(NULL, AQDG_OBJECT_OPTIONS_STRETCHX | AQDG_OBJECT_OPTIONS_STRETCHY, dc);
@@ -224,7 +224,8 @@ int test5()
derivedDpList=AQDG_Data_Accumulate(dpList); derivedDpList=AQDG_Data_Accumulate(dpList);
AQDG_TimeGraph_AddCurve(g, "Accumulated", AQDG_GRAPH_TYPE_LINE, derivedDpList); AQDG_TimeGraph_AddCurve(g, "Accumulated", AQDG_GRAPH_TYPE_LINE, derivedDpList);
AQDG_TimeGraph_SetupTicks(g);
AQDG_TimeGraph_SetupTicks(g, 0, 0.0, 0.0);
dc=AQDG_Draw_ContextCairo_Png_new("/tmp/testgraph.png", 800, 600); dc=AQDG_Draw_ContextCairo_Png_new("/tmp/testgraph.png", 800, 600);
graphObject=AQDG_GraphWidget_new(NULL, AQDG_OBJECT_OPTIONS_STRETCHX | AQDG_OBJECT_OPTIONS_STRETCHY, dc); graphObject=AQDG_GraphWidget_new(NULL, AQDG_OBJECT_OPTIONS_STRETCHX | AQDG_OBJECT_OPTIONS_STRETCHY, dc);
@@ -234,17 +235,9 @@ int test5()
AQDG_GraphWidget_SetupDefaultPens(graphObject); AQDG_GraphWidget_SetupDefaultPens(graphObject);
AQDG_GraphWidget_SetupDefaultFonts(graphObject); AQDG_GraphWidget_SetupDefaultFonts(graphObject);
AQDG_GraphWidget_SetupForGraph(graphObject, g); AQDG_GraphWidget_FinishWithGraph(graphObject, g);
AQDG_Object_ModifyBranchFlagsDown(graphObject, AQDG_OBJECT_FLAGS_RECALC, AQDG_OBJECT_FLAGS_RECALC);
AQDG_Object_ModifyBranchFlagsDown(graphObject, AQDG_OBJECT_FLAGS_LAYOUT, AQDG_OBJECT_FLAGS_LAYOUT);
AQDG_Object_Layout(graphObject);
AQDG_Object_Tree2_CalculateAbsPositions(graphObject);
AQDG_Object_Dump(graphObject, 2); AQDG_Object_Dump(graphObject, 2);
AQDG_DrawableWidget_Draw(graphObject);
AQDG_Draw_Context_Finish(dc);
return 0; return 0;
} }